我正在尝试构建一个包并将其上传到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
提交
取消