4

I have a virtualenv all set up with the --no-site-packages flag on.

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

When I ran python manage.py sycndb I get the error.

ImportError django.contrib.staticfiles: No module named staticfiles

I know this is a feature of 1.3 and should work. When I go in to the python shell and type

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

Any idea why I get back 1.2 I have the vitrualenv on and know I am in it because I can import other things I have installed. Everything but django seems to work. It seems I am getting a ghost verson or another version installed on my machine, but that shouldnt happen beacause of the --no-site-packages, right?

2
  • Just made an empty brand new virtualenv --no-site-packages venv went in source bin/active , then python. Still getting back django.VERSION 1.2. Commented Apr 6, 2011 at 16:40
  • 1
    Don't know what system you're on, but maybe your paths are somehow mixed up and some wrong python interpreter is run. Try explicitly running bin/python in your virtualenv! Commented Apr 6, 2011 at 16:48

1 Answer 1

5

Can you perform the following checks:

  1. Are you using python from your virtualenv?

    which python

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

  2. Open a python shell and check where your django is coming from:

    python

    >>> import django

    >>> django.__path__

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

  3. When you run your pip install command, have you activated your virtual environment?

Sign up to request clarification or add additional context in comments.

2 Comments

Solved it. It seems awhile ago. I hard coded django path to in my .bash_profile and That seemed to be overriding my django calls.
@Raisins This is exactly the problem I was having, and I couldn't figure out why! Thanks for pointing this out.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.