How to activate the virtual environment for python?

Solution 1:

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.

Solution 2:

To activate the virtual environment in the terminal enter the following command:-
For Linux, source envName/bin/activate
For windows, envName/scripts/avtivate

Solution 3:

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