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

‘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没有响应,这也是虚拟环境问题,需要到虚拟环境下执行
虚拟环境执行

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

要生成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
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值