I can't activate the venv on my new project (new to Python too),
If I do python --version
: Python 3.7.2
I created the venv using ' $ python -m venv ./venv ' in my editor (vs code).
and now to activate is where I have a problem,
Attempt 1:
$ ./venv/Scripts/activate.bat
error : 'C:\Users\name' is not recognized as an internal or external command, operable program or batch file.
The system cannot find the path specified.
My user name is formatted from 2 names "name & name" with space between them! Is that a problem? It just show first name and not the second.
Attempt 2:
$ C:\Users/name & name/Desktop/ProjectFolder/venv/Scripts/activate.bat
error:
[1] 15160
bash: C:Users/name: No such file or directory
bash: name/Desktop/ProjectFolder/venv/Scripts/activate.bat: No such file or directory
[1]+ Exit 127 C:\Users/name
Try using the terminal to navigate to the folder that contains your virtual environment using the change directory (cd) command. Once there, try typing:
source ./venv/Scripts/activate
Also, try opening the venv folder and make sure your activate file is in the 'Scripts' folder and not the 'bin' folder. When I create a virtual environment, I use:
source ./venv/bin/activate
Try C:/Users/name & name/Desktop/ProjectFolder/venv/Scripts/activate.bat
. Note the exclamation marks and backslash file separator changed to forward slash.
Another way is:
C:/Users/name\ &\ name/Desktop/ProjectFolder/venv/Scripts/activate.bat
Note the \
as escape character and backslash file separator changed to forward slash.
And as another option, you can go to directory:
cd 'C:/Users/name & name/Desktop/ProjectFolder/venv/Scripts'
and than run activate.bat
from directory.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With