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

91

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

85

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

80

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

67

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

55

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?

Related QUESTION?