【几个python虚拟环境会遇到的问题】

几个python虚拟环境会遇到的问题

    • 'twine' is not recognized as an internal or external command,operable program or batch file.
    • setup命令不报错但不起作用
    • 'pipreqs' is not recognized as an internal or external command,operable program or batch file.

‘twine’ is not recognized as an internal or external command,operable program or batch file.

无法识别twin命令

这个错误的时候可以使用以下方式
(python39) D:\workspace\Python\BottlePie>python -m twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Enter your username: jiangcheng1806
Enter your password:
Uploading todolist_JIANG.CHENG-0.0.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 8.3/8.3 kB • 00:00 • ?
Uploading todolist-JIANG.CHENG-0.0.1.tar.gz
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.5/7.5 kB • 00:00 • ?

View at:
https://pypi.org/project/todolist-JIANG.CHENG/0.0.1/

(python39) D:\workspace\Python\BottlePie>
参考的解释:https://stackoverflow.com/questions/51469451/issue-uploading-a-python-package-to-pypi-using-windoes-10-twine-is-not-recogni

setup命令不报错但不起作用

setup命令没有作用

在文件夹下使用python开头执行setup.py没有响应,这也是虚拟环境问题,需要到虚拟环境下执行
【几个python虚拟环境会遇到的问题】_第1张图片

‘pipreqs’ is not recognized as an internal or external command,operable program or batch file.

要生成requirements,需要使用pipreqs,但是以下命令报错了
【几个python虚拟环境会遇到的问题】_第2张图片
(python39) D:\workspace\Python\BottlePie>python pipreqs . --encoding=utf8 --force
python: can’t open file ‘D:\workspace\Python\BottlePie\pipreqs’: [Errno 2] No such file or directory

(python39) D:\workspace\Python\BottlePie>python pip -m pipreqs . --encoding=utf8 --force
python: can’t open file ‘D:\workspace\Python\BottlePie\pip’: [Errno 2] No such file or directory

(python39) D:\workspace\Python\BottlePie>python -m pipreqs . --encoding=utf8 --force
D:\ProgramData\anaconda3\envs\python39\python.exe: No module named pipreqs.main; ‘pipreqs’ is a package and cannot be directly executed

最终使用以下命令成功运行

python -m pipreqs.pipreqs . --encoding=utf8 --force

你可能感兴趣的:(python,开发语言)