Liam Tarr
Liam Tarr

Reputation: 21

Problems with django and virtualenv

EDIT: Well, looks like I already found a solution. I just used the full path to the django-admin.py file and it worked.


So you're aware, in my virtualenv I'm running Python 2.7.5 32 Bit.

I'm following Tango with Django Chapter 3.2.

It says to run:

django-admin.py startproject tango_with_django_project

It responds with:

ImportError: No module named django.core

I've already tried fixing the PYTHONPATH using add2virtualenv, but I can't seem to get it to work.

Currently my PYTHONPATH in the virtualenv is C:\Users\Liam\Envs\rango\Scripts\python.exe

I want to change it to C:\Users\Liam\Envs\rango\Lib\Scripts

Thanks for your help!

Upvotes: 1

Views: 155

Answers (1)

dm03514
dm03514

Reputation: 55972

I don't use windows (so hopefully the following is still up to date), but I believe you need to activate your env to get it to work:

To use an environment, run the activate.bat batch file in the Scripts subdirectory of that environment. Your command prompt will change to show the active environment. Once you have finished working in the current virtual environment, run the deactivate.bat batch file to restore your settings to normal.

Of course you could also directly reference your scripts, as you have already discovered

Upvotes: 1

Related Questions