Question

Somehow, I've managed to install two versions of pip -- an older one (I assume installed using apt-get) when using:

pip --version

and a brand new version (I'm not sure how it got there) when using:

sudo pip --version

I have no idea how to get the new one uninstalled. Apt-get autoremove will get rid of the old one. Can somebody shed some light on what I've done wrong, and how to fix it?

Was it helpful?

Solution

When confronted with this mysteries you should always search the absolute path of what you're executing. You obviously are executing two different commands, and in order for that to happen the PATH environment variable of your user is different than the one of your root user. You can compare them by executing:

$ echo $PATH
$ sudo su
# echo $PATH

You can search through those directories and find the different pip scripts. My bet is that you have a local pip installation that lives in one of the directories mentioned in root's $PATH.

If you want to know the version of the pip installed by your package management tool, just issue the following command:

$ dpkg -l | grep python-pip

Run the following command if you want to know what files where installed by this package.

$ dpkg -L python-pip

Having found the culprit using this methods, you can now uninstall the version you don't need.

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