Search code examples
djangopythonanywhere

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


Solution

  • 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.