我正在嘗試構建一個包并將其上傳到pypi,我已經過了這一點并且上傳成功,讓我引導您完成我正在做的事情:setup.py:from setuptools import setup, find_packagessetup( name='project_name', version='1.0', packages=find_packages(), url='url', license='license', author='author', author_email='email_here@some_mail.com', description='description', install_requires=[ 'oauth2client', 'pyarrow', 'pandas', 'requests', 'gcloud' ],)我愿意:% python3 setup.py sdist bdist_wheel其次是% python3 -m twine upload -u username -p password --repository-url https://test.pypi.org/legacy/ dist/*兩者都運行得很好,沒有錯誤/警告......然后我得到一個包含以下內容的網址:% pip install -i https://test.pypi.org/simple/ project_name==1.0所以我創建一個virtualenv環境并嘗試安裝:% virtualenv test_env% source test_env/bin/activate% pip install -i https://test.pypi.org/simple/ project_name==1.0出于某種原因,我一開始就明白了:ERROR: Could not find a version that satisfies the requirement gcloud (from project_name==1.0) (from versions: none)ERROR: No matching distribution found for gcloud (from project_name==1.0)然后,在重試(未應用任何更改)運行最后一個命令后,我得到了其他結果,并且還得到了其他結果。那么……怎么了?
1 回答

米琪卡哇伊
TA貢獻1998條經驗 獲得超6個贊
我認為這是因為 pip 正在尋找https://test.pypi.org/simple/
不存在的包依賴項。
嘗試:
pip install --index-url https://test.pypi.org/simple/ --extra-index-url https://pypi.org/simple your-package
這會拉出你的包,但當pip 無法找到依賴項時,test.pypi
就會恢復正常。pypi
添加回答
舉報
0/150
提交
取消