Question

On Ubuntu 10.04, my problem is that pip freeze and sudo pip freeze both report the wrong version of a package installed. I can do sudo pip install -I pycrypto --upgrade and it will go through and install the package (version 2.6.1), but then pip freeze lists the installed version as 2.0.1. I also cannot uninstall the package, so it seems like something is going wrong. How can I fix this?

Output:

$ sudo pip uninstall pycrypto
Can't uninstall 'pycrypto'. No files were found to uninstall.
$ pip uninstall pycrypto
Can't uninstall 'pycrypto'. No files were found to uninstall.

For reference and common issues, I have pip installed, and can do:

$ pip --version
pip 1.5.2 from /usr/local/lib/python2.6/dist-packages (python 2.6)

And I see the correct pip version, seems like everything is good there. sudo pip --version also yields the same output. I can diff the outputs from pip freeze and sudo pip freeze and there are no differences there. which pip and sudo which pip yield the same thing.

More Info:

If I do pip install -I pycrypto --upgrade without sudo I get an error that maybe someone could clarify? When I install with sudo I get no errors. I feel like this is related, but not my issue.

InstallationError: Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_ndempkow/pycrypto/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-KkVjn4-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_ndempkow/pycrypto

Was it helpful?

Solution

So for anyone who has a similar issue, I think the problem is that I somehow had the python-crypto package installed from aptitude, as well as pycrypto installed with pip. To check this I did dpkg --get-selections and saw that python-crypto was installed, so I removed that with sudo apt-get remove python-crypto and then I was able to do sudo pip uninstall pycypto. That finally got it to disappear from pip freeze so I could then install the correct version.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top