我正在尝试使用twine
将包发布到 PyPi .在项目文件夹中运行twine upload dist/*
会得到-bash: twine: command not found
。
我在MacOS Mojave上使用Python 3.7.7。我已经成功运行了pip install twine
,运行pip3 install twine
告诉我twine
已安装。
我看到过其他答案,建议我将安装twine
的目录添加到~/.bash_profile
$PATH
中。跑步pip show -f twine
给我:
Name: twine
Version: 3.1.1
Summary: Collection of utilities for publishing packages on PyPI
Home-page: https://twine.readthedocs.io/
Author: Donald Stufft and individual contributors
Author-email: donald@stufft.io
License: UNKNOWN
Location: /Users/Username/Library/Python/3.7/lib/python/site-packages
Requires: requests, importlib-metadata, tqdm, keyring, requests-toolbelt, setuptools, readme-renderer, pkginfo
Required-by:
Files:
../../../bin/twine
后跟文件列表。
我添加了/Users/Username/Library/Python/3.7/lib/python/site-packages/bin
,/Users/Username/Library/Python/3.7/lib/python/site-packages
,并根据各种答案/Users/Username/Library/Python/3.7/lib/bin
$PATH
,并且错误仍然存在。
我在$PATH
中添加了/Users/Username/Library/Python/3.7/lib/python/bin
和/Users/Username/Library/Python/3.7/lib/bin
,这似乎已经解决了问题。