我正在为我自己的包创建一个setup.py
。我的包需要Python依赖项“rarfile”。因此,在{
setup(
...
install_requires=[ 'rarfile' ],
)
不幸的是,当我构建包、将其上载到test.pypi并进行测试安装时,它失败了,并抱怨没有匹配的rarfile发行版。奇怪的是,我可以使用pip3手动安装rarfile,没有任何问题,而且它可以正常工作
在我的软件包上使用pip3进行测试安装:
pip3 install --no-cache-dir --index-url https://test.pypi.org/simple/ droidlysis
Collecting droidlysis
Downloading https://test-files.pythonhosted.org/packages/01/e8/f7542484ba4acd6a2d079a22c29cd88dcf63cd8334ffa3de29fa5b0ea7a0/droidlysis-3.0.11.tar.gz (40kB)
100% |████████████████████████████████| 40kB 975kB/s
Collecting rarfile==3.1 (from droidlysis)
Could not find a version that satisfies the requirement rarfile==3.1 (from droidlysis) (from versions: )
No matching distribution found for rarfile==3.1 (from droidlysis)
使用pip3直接安装rarfile
:
$ pip3 install rarfile==3.1
Collecting rarfile==3.1
Using cached https://files.pythonhosted.org/packages/88/0b/107dde3f330d04668e126932a09002ac47348841453aa0391634381fa087/rarfile-3.1.tar.gz
Building wheels for collected packages: rarfile
Running setup.py bdist_wheel for rarfile ... error
Complete output from command /home/axelle/softs/myvirtualenvs/testdroidlysis/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-yj6ptg3b/rarfile/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpnlukg8ugpip-wheel- --python-tag cp36:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: invalid command 'bdist_wheel'
----------------------------------------
Failed building wheel for rarfile
Running setup.py clean for rarfile
Failed to build rarfile
Installing collected packages: rarfile
Running setup.py install for rarfile ... done
Successfully installed rarfile-3.1
您使用了
index-url https://test.pypi.org/simple/
,因此pip
只查看该索引,而不查看其他索引没有
https://test.pypi.org/project/rarfile
,因此安装确实失败或者
index-url
开关同时包含pypi.org/index
和test.pypi.org/index
extra-index-url
将test.pypi.org/index
添加到要搜索的位置问题在于
index-url URL
开关这将替换默认的
pypi.org
,并完全忽略它。 使用extra-index-url URL
考虑默认的pypi.org测试索引does not exist ^{}
{}的帮助:
index-url
选项覆盖默认索引url;这并没有增加它。 请改为使用extra-index-url
:相关问题 更多 >
编程相关推荐