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

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?



Solution 1:[1]

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.

Solution 2:[2]

I solved the similar problem running python3.7 -m venv venv, you can change for your version of python that is installed in your enviroment.

Solution 3:[3]

I solved a similar problem by naming it venv2 when I ran virtualenv. I already had a virtual environment named venv for another project. This allowed me to proceed.

Solution 4:[4]

I experienced this problem when using the --upgrade option. Removed the option, and all ran as expected.

Solution 5:[5]

According to Python doc, the installation step is

$ python3 -m pip install --user virtualenv

$ python3 -m venv env

The last command gives a warning message,

The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.
$ sudo apt-get install python3-venv

Now, activate is available.

Solution 6:[6]

I double it is caused by some networking issue, I run it twice to get 'activate' script installed. Maybe first it can't connect to some source so it just abort installation.

Solution 7:[7]

I had this happen on rasbian when I hadn't installed python3-pip before creating the venv.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 crmpicco
Solution 2 Paulemberg Lima Silva
Solution 3 Steve Scott
Solution 4 Brenton Carbins
Solution 5 WhaSukGO
Solution 6 Xiaoquan Li
Solution 7 Dustin Wyatt