ltbesh
ltbesh

Reputation: 667

Wrong python binary virtualenv

I recently installed virtualenv and virtualenvwrapper on my mac to work on a Django Project.

My problem is that when I am in my virtualenv and I enter python manage.py runserver, for some reason the python binary used is not the one inside my virtualenv. I have a mac book air with OS 10.8.3

When I enter name_of_virtualenv/bin/python manage.py runserver everything works fine.

When I run which python I get : /Library/Frameworks/Python.framework/Versions/2.7/bin/python

How can I change that so that the default python is the good one ?

I did not specify any python version in my requirements.txt.

Thanks for your help

Upvotes: 0

Views: 1382

Answers (1)

Lennart Regebro
Lennart Regebro

Reputation: 172181

You probably haven't activated the environment. You do that either by:

source ./bin/activate

or with virtualenvwrapper:

workon <theenvname>

Note that you don't need to do any of this. Running Django with

./bin/python manage.py runserver

Works just fine. You don't have to actually activate the virtualenv. Personally I never do.

Upvotes: 1

Related Questions