python - How to activate virtualenv in Linux?

ID : 10329

viewed : 44

Tags : pythonlinuxvirtualenvpython

Top 5 Answer for python - How to activate virtualenv in Linux?

vote vote


Here is my workflow after creating a folder and cd'ing into it:

$ virtualenv venv --distribute New python executable in venv/bin/python Installing distribute.........done. Installing pip................done. $ source venv/bin/activate (venv)$ python 
vote vote


You forgot to do source bin/activate where source is a executable name. Struck me first few times as well, easy to think that manual is telling "execute this from root of the environment folder".

No need to make activate executable via chmod.

vote vote


You can do

source ./python_env/bin/activate 

or just go to the directory

cd /python_env/bin/ 

and then

source ./activate 

Good Luck.

vote vote


Go to the project directory. In my case microblog is the flask project directory and under microblog directory there should be app and venv folders. then run the below command, This is one worked for me in Ubuntu.

source venv/bin/activate 

enter image description here

vote vote


Cd to the environment path, go to the bin folder. At this point when you use ls command, you should see the "activate" file.

now type

source activate 

Top 3 video Explaining python - How to activate virtualenv in Linux?