如果在pip中链接断开,如何在virtualenv中安装库

时间:2014-10-14 08:05:37

标签: python pip openerp virtualenv pychart

所以我想安装需要pychart的openerp 7.0.406,它的唯一链接似乎在pip中断了。

No distributions at all found for pychart in ./env/lib/python2.7/site-packages (from openerp-core==7.0.406->-r picdyn_openerp_conf/requirements (line 11))

在日志中我们有:

URLs to search for versions for pychart in ./env/lib/python2.7/site-packages (from openerp-core==7.0.406->-r picdyn_openerp_conf/requirements (line 15)):
* https://pypi.python.org/simple/pychart/
Analyzing links from page https://pypi.python.org/simple/pychart/
  Skipping link http://www.hpl.hp.com/personal/Yasushi_Saito/pychart (from https://pypi.python.org/simple/pychart/); not a file
Not searching http://www.hpl.hp.com/personal/Yasushi_Saito/pychart (from https://pypi.python.org/simple/pychart/) for files because external urls are disallowed.
Could not find any downloads that satisfy the requirement pychart in ./env/lib/python2.7/site-packages (from openerp-core==7.0.406->-r picdyn_openerp_conf/requirements (line 15))

检查uri时,返回404未找到。所以我从其他地方(http://download.gna.org/pychart/)下载了pychart,我试图安装它(在我的virtualenv中)。

pip install PyChart-1.39.tar.gz 
Installing collected packages: PyChart
  Running setup.py install for PyChart
Successfully installed PyChart

看起来,它并没有真正起作用,因为当我再次尝试从我的需求文件更新时,pip仍尝试访问" http://www.hpl.hp.com/personal/Yasushi_Saito/pychart"使用相同的错误消息并且openerp无法安装。

但是当我尝试重新安装pychart时,它说pychart实际上是安装的:

pip install PyChart-1.39
Requirement already satisfied (use --upgrade to upgrade): PyChart==1.39 from file:///home/pierre/PyChart-1.39 in ./env/lib/python2.7/site-packages

我做错了吗?是安装pychart还是openerp的依赖性存在问题?是否PyChart与pychart的pip不同?

3 个答案:

答案 0 :(得分:6)

您可以尝试更改PyChart中使用Python-Chart替换无效requirements.txt的要求:

  

Python的图表== 1.39

它对我有用。

答案 1 :(得分:3)

你是正确的,因为某种原因,它不是pypi。要安装它,请运行

pip install http://download.gna.org/pychart/PyChart-1.39.tar.gz

如果你想清理你的第一次使用pip uninstall

答案 2 :(得分:0)

如果您使用--allow-external--allow-unverified从外部源安装,则此功能正常。

但是没有--allow-all-unverified因为我有几个问题(pychartpyxmlopenerp-core)我逐个添加了它们。我还在寻找一种方法来允许多个未经验证的...(--allow-unverified a b"a b"a,b不起作用。

但正如Adrian Merrall所说,在 requirements.txt 而不是PyChart==1.39中添加完整网址会更加清晰:

http://download.gna.org/pychart/PyChart-1.39.tar.gz

因为您甚至不需要--allow-external--allow-unverified选项,也不需要以不同方式处理Pychart。