问一个有关于 pip 安装远程仓库上的依赖的问题

2017-05-15 15:12:56 +08:00
 huisezhiyin
是这样 我司一直有一个自己做的依赖包 长期放在 gitlab 上 安装时通过 pip install git+ssh git@xxxxxx 来进行安装
最近在用阿里云的一个 sdk 这个 sdk 只能通过下载到本地之后使用 python setup install 来安装 如果使用 pip install git+ssh 就会报错
Complete output from command python setup.py egg_info:
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
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 'egg_info'

----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-_Uz0Zr-build/
我尝试去除了 setup 文件中的 distribution.croe.setup 并用 setuptools.setup 替代
但仍然报这个错
我后来直接删除了 install_requires 这个参数
仍然报错 (只是报错信息里没有 /usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'了)
请问该如何解决这个问题 让这个模块可以通过 pip install git+ssh 安装呢?

模块地址:https://github.com/aliyun/aliyun-log-python-sdk
2308 次点击
所在节点    Python
2 条回复
guyskk
2017-05-15 20:12:01 +08:00
setuptools 导入了项目里面的 pkg_resources, 而这个 pkg_resources.py 可能有问题或者比较老了,现在的 setuptools 是自带 pkg_resources 的,可以把项目里的那个删掉
huisezhiyin
2017-05-15 20:31:49 +08:00
@guyskk 握草厉害 非常感谢

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/361436

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX