当pip中的链接断开时,如何在虚拟机中安装库



所以我想安装需要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 not found。所以我从其他地方下载了pychart(http://download.gna.org/pychart/),我试着安装它(在我的虚拟环境中)。

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与pip的PyChart不同吗?

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

Python图表==1.39

它对我有效。

由于某种原因,它不在pypi中,这是正确的。要安装它,请运行

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

如果你想清理你首先使用pip卸载

如果您使用--allow-external--allow-unverified从外部源进行安装,则它会起作用。

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

但正如Adrian Merrall所说,在requirements.txt中添加完整的URL而不是PyChart==1.39:要干净得多

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

因为您甚至不需要--allow-external--allow-unverified选项,也不需要区别对待Pychart。

最新更新