Pierre.Sassoulas
Pierre.Sassoulas

Reputation: 4282

How to install a library in a virtualenv when its link is broken in pip

So I want to install openerp 7.0.406 that require pychart and the only link for it seems broken in 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))

In the log we have :

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))

When you check the uri it return a 404 not found. So I downloaded pychart from somewhere else (http://download.gna.org/pychart/), and I tried to install it (being in my virtualenv).

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

It seem, it's not really working because when i try again to update from my requirements file, pip still try to access "http://www.hpl.hp.com/personal/Yasushi_Saito/pychart" with the same error message and openerp fail to install.

But when i try to reinstall pychart, it says pychart is in fact installed :

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

Am I doing something wrong ? Is pychart installed or is there a problem with the dependancies of openerp ? Is PyChart different from pychart for pip ?

Upvotes: 3

Views: 4697

Answers (3)

lucky kurniawan
lucky kurniawan

Reputation: 136

You can try, changing the requirement replacing the invalid PyChart with Python-Chart in your requirements.txt:

Python-Chart==1.39

It works for me.

Upvotes: 6

Pierre.Sassoulas
Pierre.Sassoulas

Reputation: 4282

It works if you use --allow-external and --allow-unverified in order to install from an external source.

But there is no --allow-all-unverified so as I had several problems (pychart, pyxml, openerp-core) I added them one by one. I was still searching for a way to allow multiple unverified... (--allow-unverified a b, "a b", or a,b don't work).

But as Adrian Merrall said it's a lot cleaner to add the full URL in requirements.txt instead of PyChart==1.39:

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

Because you don't even need the --allow-external or --allow-unverified options and you don't need to treat Pychart differently.

Upvotes: 0

Adrian Merrall
Adrian Merrall

Reputation: 2499

You are correct that it isn't in pypi for some reason. To install it run

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

If you want to clean up what you have first use pip uninstall

Upvotes: 3

Related Questions