user7515195
user7515195

Reputation:

About virtualenv and version of python?

I need help in understanding with venv. I have installed venv with virtualenv venv -p python3.6. I have activated it (venv) and install django

pip django`install django`

And so, when I work with my project should I always activate venv or not? Because I run my manage.py without venv and using python2, but I need python3. And then I run with active venv with python3 I got mistakes like this:

ModuleNotFoundError: No module named 'forms'

Upvotes: 0

Views: 66

Answers (2)

Sashini Hettiarachchi
Sashini Hettiarachchi

Reputation: 1708

I also use python3.5.2 and I created a virtual environment using the following command

python3 -m venv venv

And activated it using the following command

. venv/bin/activate

I always activate the virtual environment before running the application

Upvotes: 2

thebjorn
thebjorn

Reputation: 27351

You must activate the virtualenv before calling pip install ... (potentially using pip3 with Python 3.x) and also every time you need to work with the virtualenv (e.g. before calling python manage.py ...)

Upvotes: 1

Related Questions