I want to install version 1.3.1 of Django in a new virtualenv. I already have Django version 1.3.0 installed on the system. I installed virtualenv using no-site-packages and tried to reinstall Django as follows, but without success:
$ virtualenv --no-site-packages pyenv New python executable in pyenv/bin/python Installing setuptools............done. Installing pip...............done. $ source pyenv/bin/activate (pyenv)$ python Python 2.6.6 (r266:84292, May 26 2011, 21:27:16) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.VERSION (1, 3, 0, 'final', 0)
OK, so although I did not install Django and I used no-site-packages , virtualenv still somehow took the system version.
Now try rewriting it with version 1.3.1:
(pyenv)$ pip install django==1.3.1 Downloading/unpacking django==1.3.1 Downloading Django-1.3.1.tar.gz (6.5Mb): 6.5Mb downloaded Running setup.py egg_info for package django Installing collected packages: django Found existing installation: Django 1.3 Not uninstalling Django at /opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages, outside environment /Users/anna/Dropbox/code-local/pyenv/pyenv/bin/.. Running setup.py install for django changing mode of build/scripts-2.6/django-admin.py from 644 to 755 changing mode of /Users/anna/Dropbox/code-local/pyenv/pyenv/bin/django-admin.py to 755 Successfully installed django Cleaning up... (pyenv)$ python Python 2.6.6 (r266:84292, May 26 2011, 21:27:16) [GCC 4.2.1 (Apple Inc. build 5664)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> import django >>> django.VERSION
This did not work, it still points to 1.3.0!
Pay attention to the line: Found existing installation: Django 1.3 Not uninstalling Django .
How can I get my virtualenv to use 1.3.1? Do I need to edit my local Python path?
I am confused why virtualenv can even see the Django system when I am explicitly installed with no-site-packages . Is this the way it should work?