从dependency_links安装包时的问题
这是我的setup.py文件:
setup(
...
install_requires=['GEDThriftStubs'],
dependency_links=['git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs'],
...)
然后我创建了一个包:
python setup.py sdist
接着我尝试安装它:
pip install file://path/package-0.0.1.tar.gz
在终端里我看到这个信息:
Downloading/unpacking GEDThriftStubs (from package==0.0.1)
Could not find any downloads that satisfy the requirement GEDThriftStubs (from package==0.0.1)
No distributions at all found for GEDThriftStubs (from package==0.0.1)
在pip.log文件中出现了这样的消息:
Skipping link git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs; wrong project name (not gedthriftstubs)
而且在我的项目中并没有叫“gedthriftstubs”的东西,不知道这是否重要。
不过这个是可以正常工作的:
pip install git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs
1 个回答
1
试试这个:
$ pip install --process-dependency-links file://path/package-0.0.1.tar.gz
注意,这个标签在 pip 1.6 版本中被移除了。想了解更多信息,可以查看这个 pip.pypa.io 的文章。
在 pip 1.5 版本中,处理依赖链接的功能被弃用了,而在 pip 1.6 版本中完全移除了。
关于 pip 和依赖链接,还有一个 比较长的讨论 (问题 #1519)。
如果这样还不行,你可能还需要在你的链接上加上版本后缀,比如这样:
git+ssh://user@git.server.com/ged-thrift-stubs.git#egg=GEDThriftStubs-0.0.1
其中 0.0.1
是在 ged-thrift-stubs
的 setup.py 文件中指定的 version
。