anoop
anoop

Reputation: 57

How to activate the virtual environment for python?

My website is hosted in a PAAS provider,

made a virtual environment using below command

$ mkvirtualenv --python=/usr/bin/python3.8 mysite-virtualenv

However I can not activate it, please refer the attached image for file structure. enter image description here

Upvotes: 3

Views: 38768

Answers (3)

Ayush
Ayush

Reputation: 700

To activate the virtual environment in the terminal enter the following command:-
For Linux,

source envName/bin/activate

For windows,

envName/scripts/activate

Upvotes: 0

Filip
Filip

Reputation: 676

Your virtual environment was created with virtualenvwrapper. Activate it with command workon mysite-virtualenv in bash console on PythonAnywhere.

For the web app you need to set it on the "Web" configuration page.

Upvotes: 2

MaxDragonheart
MaxDragonheart

Reputation: 1290

As indicated in official Python's documentation, You can create the environment with:

python3 -m venv NAMENEV

and activate with:

NAMENEV\Scripts\activate.bat # ON WINDOWS
source NAMENEV/bin/activate # ON LINUX/MAC

Upvotes: 6

Related Questions