我正在尝试使用 twine 将我的包上传到 PyPI。
我已经关注了official documentation我在这一步被阻止了:
tine上传dist/*
我之前的任何步骤都没有错误,并且我一直使用 python3 而不是 python(因此之前的所有步骤都使用了 python3 或 pip3)
$ twine upload dist/*
Invalid command: upload
$ which twine
/usr/local/bin/twine
$ twine --version
Twine version 1.0.1
$ which python3
/usr/local/bin/python3
结果我安装了不同的麻线,this one ,导致错误。如何删除当前安装的 twine 并安装正确的 PyPi Twine?
更新 1
我已经删除了其他版本的麻线。我运行了 pip3 install twine ,它给出了很多已经满足的需求行: twine in/Users/.....
但如果我运行 twine - -version
我得到-bash: twine: command not find
最佳答案
您的 $PATH 中是否还有其他与 twine
匹配的内容,因此它可能会使用它而不是 PyPi Twine?
从头到尾搜索$PATH,并运行第一个匹配的可执行文件。因此 $PATH 开头的目录优先于后面的目录。
关于python - 无法使用 twine 上传到 PyPI ("invalid command"),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48045513/