2

I'm trying to create python virtual environment for a project,Python 3.7.2, win 10 using command:

C:\Users\STAR WARE\Documents\Python\Tricks book>python -m venv venv

I get the following error:

Error: Command '['C:\\Users\\STAR WARE\\Documents\\Python\\Tricks book\\foo\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 101.

Note I used Administrator Command Prompt

belwood
  • 3,320
  • 11
  • 38
  • 45
Khaled Saleh
  • 79
  • 1
  • 8
  • Hi Khaled, firstly do you venv installed? Also have you tried using something like anaconda, it makes running and installing python packages easier in Windows – Ronald Das Mar 30 '19 at 17:35
  • I've anaconda installed, besides I've another Python 3.7.2 installed and added to the path environment. I use anaconda for Notebook, and my favorite editor is Sublime Text uses the python on the path. – Khaled Saleh Mar 31 '19 at 00:25

1 Answers1

1

I've tried instead 'virtualenv' in place of 'python -m venv' and it worked as below:

C:\Users\STAR WARE\Documents\Python\Tricks book>python -m venv virt1
Error: Command '['C:\\Users\\STAR WARE\\Documents\\Python\\Tricks book\\virt1\\Scripts\\python.exe', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 101.

C:\Users\STAR WARE\Documents\Python\Tricks book>pip install virtualenv

Requirement already satisfied: virtualenv in c:\users\star ware\appdata\local\programs\python\python37\lib\site-packages (16.4.3)

C:\Users\STAR WARE\Documents\Python\Tricks book>virtualenv virt2
Using base prefix 'c:\\users\\star ware\\appdata\\local\\programs\\python\\python37'
New python executable in C:\Users\STARWA~1\DOCUME~1\Python\TRICKS~1\virt2\Scripts\python.exe
Installing setuptools, pip, wheel...
done.
Community
  • 1
  • 1
Khaled Saleh
  • 79
  • 1
  • 8