pip - Requirement already satisfied?
Asked Answered
K

2

17

pip recognize global installed packages..?! :-(

I've used virtualenvwrapper preactivate hook to clean PYTHONPATH,

export PYTHONPATH="" 

then echo $PYTHONPATH returns empty string, but this didn't help.

What's wrong?

bentzy@lama:~$ mkvirtualenv test
New python executable in test/bin/python
Installing setuptools............done.
Installing pip...............done.
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/predeactivate
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/postdeactivate
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/preactivate
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/postactivate
virtualenvwrapper.user_scripts creating /home/bentzy/.virtualenvs/test/bin/get_env_details
(test)bentzy@lama:~$ which pip
/home/bentzy/.virtualenvs/test/bin/pip
(test)bentzy@lama:~$ sudo pip install simplejson
Requirement already satisfied (use --upgrade to upgrade): simplejson in /usr/lib    /python2.7/dist-packages
Cleaning up...
(test)bentzy@lama:~$ echo $PYTHONPATH

(test)bentzy@lama:~$ pip --version
pip 1.2.1 from /home/bentzy/.virtualenvs/test/lib/python2.7/site-packages/pip-1.2.1-py2.7.egg (python 2.7)
Kindling answered 2/2, 2013 at 18:58 Comment(4)
I haven't used virtualenvwrapper, but with virtualenv I use the --no-site-packages option. Can mkvirtualenv pass this option?Jasminjasmina
Yes - but tis is not the issue. As of virtualenv 1.7, the --no-site-packages has become the default and is deprecated. Im using 1.8.2. Anyway - I've also tried that and still didn't work as expected...Kindling
Try printing sys.path and see what's there.Rating
What does pip freeze say?Wismar
F
19

You are using sudo to install simplejson, but if you use sudo your $PATH may be changed, and that seems to be the problem.

Just use pip install simplejson (no sudo included) and it is probably going to work.

Use sudo only when you want to affect your whole system.

Finespun answered 3/2, 2013 at 17:22 Comment(1)
Also the --user option may make sense, which will install it in your ~/.local/lib/... directory. This does not require r00t privileges.Should
P
12

Already satisfied means that you already install "it".

try: pip uninstall simplejson

and then: pip install simplejson

Paulitapaulk answered 10/4, 2014 at 12:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.