Virtualenv using the wrong django

I have virtualenv all configured with the --no-site-packages flag.

When I did pip install django==1.3 , everything seemed to be just fine.

When I started python manage.py sycndb , I get an error.

ImportError django.contrib.staticfiles: No module named staticfiles

I know this is feature 1.3 and should work. When I enter the python shell and type

 >>> import django >>> django.VERSION (1, 2, 1, 'alpha', 0) 

Any idea why I'm coming back 1.2. I have vitrualenv and know that I am in it, because I can import other things that I installed. Everything except the django seems to work. I seem to get the ghost verson or another version installed on my machine, but this should not come from -no-site-packages, right?

+4
source share
1 answer

Can you perform the following checks:

  • Are you using python from your virtualenv?

    which python

    /home/raisins/.virtualenvs/yourenv/bin/python

  • Open a python shell and check where django is coming from:

    python

    >>> import django

    >>> django.__path__

    >>> ['/home/raisins/.virtualenvs/yourenv/lib/python2.6/site-packages/django']

  • When you run the pip install command, have you activated your virtual environment?

+5
source

Source: https://habr.com/ru/post/1346951/


All Articles