python - Installed packages with pip are not shown in pip freeze? -


i'm using virtualenv , pip on debian wheezy. i'm having odd problem packages appear install ok, aren't visible in virtualenv.

this requirements.txt file:

django==1.7.7 psycopg2==2.5.4 django-geojson==2.6.0 

if install pip inside virtualenv, says has been installed:

(.venv)$ sudo pip install -r requirements.txt requirement satisfied (use --upgrade upgrade): django==1.7.7 in /usr/local/lib/python2.7/dist-packages (from -r requirements/base.txt (line 1)) requirement satisfied (use --upgrade upgrade): psycopg2==2.5.4 in /usr/local/lib/python2.7/dist-packages (from -r requirements/base.txt (line 2)) requirement satisfied (use --upgrade upgrade): django-geojson==2.6.0 in /usr/local/lib/python2.7/dist-packages (from -r requirements/base.txt (line 3)) requirement satisfied (use --upgrade upgrade): 6 in /usr/local/lib/python2.7/dist-packages (from django-geojson==2.6.0->-r requirements/base.txt (line 3)) cleaning up... 

but if pip freeze check installed, looks pip thinks have different set of packages, , in particular doesn't see djgeojson there:

(.venv)$ pip freeze django==1.7.4 argparse==1.2.1 coverage==3.7.1 distribute==0.6.24 django-debug-toolbar==1.2.1 gunicorn==19.3.0 psycopg2==2.5.4 requirements==0.1 setproctitle==1.1.8 sqlparse==0.1.14 wsgiref==0.1.2 

and if fire python terminal, python can't see djgeojson.

why happening? quite confusing.

your problem you've installed requirements sudo , installed in system python library folder instead , not in virtual environment's venv library.

what do? run same command time without sudo: pip install -r requirements.txt. run pip virtual environment , install packages right place.

when activate virtual environment e.q source path/to/my/venv/bin/acivate path variable $path of current user updated , when run sudo, new $path you've updated when activating virtual environment no longer same. same thing happens when open new shell window or logs in different user su or running sudo, $path variable not global system one.


Comments

Popular posts from this blog

Payment information shows nothing in one page checkout page magento -

tcpdump - How to check if server received packet (acknowledged) -