Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

virtualenv on Windows10 gives error:The path python3 does not exist

I'm trying the tutorial Using Cloud Datastore with Python, but when I run:

virtualenv -p python3 env

I got an error:

The path python3 (from --python=python3) does not exist

I checked the python version by running:

python -V

It gives me:

Python 3.5.2 :: Anaconda 4.1.1 (64-bit)

I run set python to see the Environment variables, which gives me:

Environment variable python not defined

An annoying thing is that, this is a lab machine which I don't have the admin right, I need to email the IT Admin to change the Environment variables.

Tried:virtualenv -p python env

It gives me:

The path python (from --python=python) does not exist

Seems there is no way around until the environment variable is fixed.

like image 986
Mzq Avatar asked Sep 10 '17 08:09

Mzq


People also ask

How do I add Python path to virtual environment?

Just put a file with a . pth extension (any basename works) in your virtualenv's site-packages folder, e.g. lib\python2. 7\site-packages , with the absolute path to the directory containing your package as its only contents.


2 Answers

After reading this tutorial, I found the workaround for my case:

virtualenv --python "C:\\Anaconda3\\python.exe" env
like image 114
Mzq Avatar answered Oct 03 '22 08:10

Mzq


Use something like this: virtualenv --python "Your python.exe path" 'Name of your virtual folder'. You can take your python.exe path from your environment variables which is in properties of your 'This PC' or 'My Computer'.

Then get into the folder and run the command: .\Scripts\activate

Enter the command pip freeze to make sure you have created your virtual environment successfully! It should return nothing since it is like an empty basket. Look atenter image description here how it comes in the picture.

like image 32
Maria Irudaya Regilan J Avatar answered Oct 03 '22 09:10

Maria Irudaya Regilan J