Can't Activate Python Venv In Windows 10
Solution 1:
This thread it old but I had the same problem today and found a working answer for it. I've been using python 3.6 venv for a few months now without issues but today I ran across a new error message:
C:\test>python -m venv vm
Error: Command '['C:\\test\\vm\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
I scoured Stack and other resources for an answer but didn't find anything specific to Windows 10. (AskUbunto had a solution that was specific to Linux). I did find breadcrumbs spread out across the InterWebs and pieced this together.
You need this python script: https://bootstrap.pypa.io/get-pip.py
Install your virtual environment as usual but without pip:
python -m venv virtual --without-pip
This method will create all of the necessary files including the activate bat files.
Copy the get-pip.py file into the virtual\Scripts subdirectory
cd into the Scripts subdirectory and "activate" python Note: the cmd line should name the directory from which python was activated:
(virtual) C:\test\virtual\Scripts>
(if it says (root), it's activated your core installation)
now execute the script
C:\test\virtual\Scripts>python get-pip.py
once run, I typed:
(virtual) C:\test\virtual\Scripts>pip freeze
to generate a freeze list and verify proper installation. It should return nothing, no error msg, no freeze list.
- Then I installed flask, tried pip freeze and noted the return was only for flask and dependent files:
(virtual) C:\test\virtual\Scripts>pip freeze click==6.7 Flask==0.12.2 itsdangerous==0.24 Jinja2==2.9.6 MarkupSafe==1.0 Werkzeug==0.12.2
Post a Comment for "Can't Activate Python Venv In Windows 10"