Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

There is no activate when I am trying to run my virtual env

Tags:

1) I installed virtualenv using pip.
2) I ran the command virtualenv venv
3) Then I ran source venv/bin/activate but it says that there is no such file or directory.

When I cd into venv/bin I find 3 things - python, python 2.7, and python 3.5. Does anyone know the problem?

like image 357
Aaron Cheung Avatar asked Jan 17 '17 01:01

Aaron Cheung


People also ask

How do I know if my virtual env is activated?

Check the $VIRTUAL_ENV environment variable. The $VIRTUAL_ENV environment variable contains the virtual environment's directory when in an active virtual environment. Once you run deactivate / leave the virtual environment, the $VIRTUAL_ENV variable will be cleared/empty.

Do I have to activate virtual environment everytime?

Don't forget to activate your Python virtual environmentBefore a virtual environment can be used in a particular shell session, it has to be activated, by way of a script named activate in the virtual environment's Scripts directory.


1 Answers

i have had the same problem. and what i did is just run the command virtualenv env again. And then more files were generated under directory env/bin, including the activate file. it's so weird.

like image 122
jiaqi jiang Avatar answered Dec 09 '22 23:12

jiaqi jiang