python - pip not installing to site-packages directory from within virtualenv when I use a requirements.txt -
i'm relatively new running python virtualenv might easy fix, can't life of me figure out what's going on. i'm running windows 7 professional x64 python 2.7.5 installed have installed pip , virtualenv. have django project i'm attempting work on have cloned heroku repository. when attempt set virtualenv , install requirements of project i'm running strange error can't figure out. have setup follows:
django project placed in c:\users\xxx\pythonprojects\myproject
i open command prompt, cd myproject folder , execute following command:
c:\users\xxx\pythonprojects\myproject> virtualenv --no-site-packages env
this should create nice clean virtual environment project, go ahead , activate follows:
c:\users\xxx\pythonprojects\myproject> scripts\activate
the prompt changes indicate virtualenv has become active double check "where"ing python , pip:
(env) c:\users\xxx\pythonprojects\myproject> python c:\users\xxx\pythonprojects\myproject\env\scripts\python.exe c:\python27\python.exe (env) c:\users\xxx\pythonprojects\myproject>where pip c:\users\xxx\pythonprojects\myproject\env\scripts\pip.exe c:\python27\scripts\pip.exe
since looks virtualenv functioning correctly next attempt pip requirements file follows:
(env) c:\users\xxx\pythonprojects\myproject> pip install -r requirements.txt
pip appears run installing packages need. when load python following happens (django 1 of packages in requirements file):
(env) c:\users\xxx\pythonprojects\myproject>python python 2.7.5 (default, may 15 2013, 22:44:16) [msc v.1500 64 bit (amd64)] on win32 type "help", "copyright", "credits" or "license" more information. >>> import django traceback (most recent call last): file "<stdin>", line 1, in <module> importerror: no module named django
i cd site-packages folder find out going on , following:
(env) c:\users\xxx\pythonprojects\myproject\lib\site-packages>dir volume in drive c windows7_os volume serial number 808f-577a directory of c:\users\xxx\pythonprojects\myproject\env\lib\site-packages 07/17/2013 02:16 pm <dir> . 07/17/2013 02:16 pm <dir> .. 07/17/2013 02:16 pm 237 easy-install.pth 07/17/2013 02:16 pm <dir> pip-1.3.1-py2.7.egg 07/15/2013 09:16 pm 332,005 setuptools-0.6c11-py2.7.egg 07/17/2013 02:16 pm 31 setuptools.pth 3 file(s) 332,273 bytes 3 dir(s) 169,869,336,576 bytes free
it appears pip call failed install site-packages folder, python has no idea find required packages. instead appear located in c:\users\xxx\pythonprojects\myproject\env\build
if use pip install foo
without requirements file, works fine , foo
ends in site-packages folder. there way can working requirements file, or going have manually install every package every time when using virtualenv? sorry overly long post, wanted make sure relevant information here. help!
edit additional information:
it appears requirements file may source of problem. half of packages being downloaded, last being django-polymorphic
. lines in requirements file specify package , following package follows:
django-polymorphic==0.4.2 -e hg+https://bitbucket.org/fcurella/django-profiles@5c982ce7c040351fca9847a85dd4ff29f8a367e6#egg=django_profiles-dev django-sekizai==0.7 -e git://github.com/divio/django-shop.git@0fb2258d27332166e3f76ad7cf7335c1f0a389b2#egg=django_shop-dev -e git://github.com/fivethreeo/django-shop-categories.git@345fb100f5f680e6ac2066f74f25515eb2cd9374#egg=django_shop_categories-dev`
so figured out answer own question.
basically, if running python 2.7 (and other versions) on windows, packages don't play nicely. if else having problem, should download windows binaries http://www.lfd.uci.edu/~gohlke/pythonlibs/ , remove packages requirements.txt
file. once did so, pip
stopped crashing during install process , correctly installed rest of packages in requirements.txt
file.
the packages needed were:
- pillow
- psycopg
- reportlab
Comments
Post a Comment