Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

like image 374
anoop Avatar asked Dec 29 '25 13:12

anoop


2 Answers

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
like image 169
Massimiliano Moraca Avatar answered Jan 01 '26 10:01

Massimiliano Moraca


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.

like image 23
Filip Avatar answered Jan 01 '26 10:01

Filip



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!