这个错误的时候可以使用以下方式
(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
在文件夹下使用python开头执行setup.py没有响应,这也是虚拟环境问题,需要到虚拟环境下执行
要生成requirements,需要使用pipreqs,但是以下命令报错了
(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