Forums

Error on PyGal upgrade

Hello,

I am trying to upgrade PyGal to the latest version 1.4.1. I ran

pip install --user pygal --upgrade

but got a long error -- the end of it reads

    Command /usr/local/bin/python2.7 -c "import setuptools, tokenize;__file__=u'/tmp/pip_build_kyspy/lxml/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read()
.replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Enrk5u-record/install-record.txt --single-version-externally-managed --compile --user failed with error
code 1 in /tmp/pip_build_kyspy/lxml
Storing debug log for failure in /home/kyspy/.pip/pip.log

How can I upgrade PyGal? From poking around the forum it seems like I might need to install in a virtualenv, but I'm not sure how those work. Can I install PyGal in a virtualenv and leave my app running where it is, or do I need to switch my whole app over into a virtualenv?

Hey there, the problem is actually when it tries to compile lxml, which will fail whether you're in a virtualenv or in the normal environment, because the libxml headers aren't available. But PyGAL should work fine with the slightly older version of lxml that we have in our batteries included.

The short answer is to use the "don't upgrade dependencies" flag for pip:

pip install --user --upgrade --no-deps pygal
pip freeze | grep -i gal   # should show the new version, 1.4.1

Then you don't need to do anything to your web app apart from reload it. You could use a virtualenv if you wanted, but then you'd need to change your app's wsgi file, and use the --system-site-packages flag... Maybe try the above first?