Reputation: 2647
I have both anaconda Python 3.5 and Python 3.5 from python.org (on windows)
python -V
Python 3.5.1 :: Anaconda 4.0.0 (64-bit)
python3 -V
Python 3.5.1
py -V
Python 2.7.12
I want to create a virtualenv with only python 3.5.1 and not the anaconda version.
When I run
python3 c:\Python35\Tools\scripts\pyvenv.py venv
python -V
still shows Python 3.5.1 :: Anaconda 4.0.0 (64-bit)
after activating the environment
Is there anyway to get it to use the native 3.5 version?
Upvotes: 0
Views: 694
Reputation:
You can use command line option -p
during venv creation to force a particular interpreter to be used with it.
python3 c:\Python35\Tools\scripts\pyvenv.py -p python3 venv
Edited:
My bad, wrong virtual environment. As I can see you use venv from standard library and it's impossible to choose particular interpreter during virtual environment creation. On the other hand python3 -m venv venv
command should use python3 interpreter for virtual environment which is one without anaconda in your case.
Edited 2:
I've just checked on windows:
C:\Users\usr>where python
C:\Python35\python.exe
C:\Users\usr\Anaconda3\python.exe
C:\Users\usr>C:\Users\usr\Anaconda3\python.exe --version
Python 3.5.2 :: Anaconda 4.1.1 (32-bit)
C:\Users\usr>C:\Users\usr\Anaconda3\python.exe -m venv myanacondavenv
C:\Users\usr>myanacondavenv\Scripts\activate.bat
(myanacondavenv) C:\Users\usr>python --version
Python 3.5.2 :: Anaconda 4.1.1 (32-bit)
(myanacondavenv) C:\Users\usr>deactivate
C:\Users\usr>C:\Python35\python.exe -m venv myvanilaenv
C:\Users\usr>myvanilaenv\Scripts\activate.bat
(myvanilaenv) C:\Users\usr>python --version
Python 3.5.1
(myvanilaenv) C:\Users\usr>deactivate
C:\Users\usr>
Upvotes: 1