Reputation: 1131
I am trying to activate my virtual environment using bash command in windows 10. I am using python 3.5.1 . F:\Python\Python35 is the location where my python.exe
is located. My virtual environment's name is myvenv
and F:\Python\virtualenvironment\myvenv is the location where my virtual environment is located. I created my virtual environment using following bash command
Nazem Mahmud@DESKTOP-VQR06GL MINGW64 /f/Python/virtualenvironment
$ python -m venv myvenv
But i can't activate it now. I used
Nazem Mahmud@DESKTOP-VQR06GL MINGW64 /f/Python/virtualenvironment
$ source myvenv/Scripts/activate
and
Nazem Mahmud@DESKTOP-VQR06GL MINGW64 /f/Python/virtualenvironment/myvenv
$ source Scripts/activate
But nothing works. It gives me error like
bash: Scripts/activate: No such file or directory
Can anyone say how can i activate my virtual environment using bash command?
Upvotes: 8
Views: 15665
Reputation: 1131
I have solved it.
At first, I install virtualenv
using following command:
Nazem Mahmud@DESKTOP-VQR06GL MINGW64 /f/Python/virtualenvironment
$ pip install virtualenv
Then I create a new virtual environment using this command:
Nazem Mahmud@DESKTOP-VQR06GL MINGW64 /f/Python/virtualenvironment
$ py -m virtualenv env
Here, env
is my virtual environment name. Next, to activate this virtual environment I ran following command:
Nazem Mahmud@DESKTOP-VQR06GL MINGW64 /f/Python/virtualenvironment
$ source env/Scripts/activate
Upvotes: 10
Reputation: 118
I also had a similar problem but it was because I was in the same directory as my virtual environment. Try navigating back to the root directory (use cd-
) of the project and activate your virtual environment.
Upvotes: 0