Nuance
Nuance

Reputation: 101

About different python versions installation

Is it possible to install 3 different python versions on windows 10 simultaneously? I'm using 2.7 for Udacity course, 3.6 for my college project and now I need to install Python 3.5 for "Tensorflow" package. Is it possible to have? Or is there any way to install tensorflow on python 3.6? Any suggestions will be appreciated.

Upvotes: 0

Views: 632

Answers (4)

Susa
Susa

Reputation: 361

  1. Everyone prefers different ways of using different Python versions. So what I prefer the most is to define different variables for your different Python versions and add/remove the variables in the System variable PATH to use a different Python Version.

    So for example: If you are using anaconda for Python 3, you may make a variable conda3 and add the following in it:

    C:\Anaconda3;C:\Anaconda3\Library\mingw-w64\bin;C:\Anaconda3\Library\usr\bin;C:\Anaconda3\Library\bin;C:\Anaconda3\Scripts;

    So of course, the values Change depending on where you have installed python.

    In a similiar way you can add Python2 and depending on which Version you want to use, you May add(taking the above example as the basis) %Anaconda3% to your System variable PATH.

Note: Even if you are adding different python variables in the System variable PATH, the System stops searching another python Version as soon as it finds the first one.

  1. If you are using anaconda for python 3.6, I see no Problem in installing tensorflow for python 3.6 - so you can simply do: conda install tensorflow and that should work

Upvotes: 0

Beomagi
Beomagi

Reputation: 81

Yes just call it directly. I use python 2, python 3 and pypy.

Call the binary directly - e.g. c:\python27\python.exe myfile.py

When installing packages you can use this as well e.g. c:\python27\python.exe -m pip install pillow

Alternatively - or in parallel, you can use the Windows subsystem for Linux. https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

This is separate from your windows installs.

In the window's bash terminal:

python 2: sudo apt-get install python python 3: sudo apt-get install python3

for python 2 pip: sudo apt-get install python-pip or for python 3 sudo apt-get install python3-pip

Upvotes: 1

Nicolas M.
Nicolas M.

Reputation: 1478

Yes you can have multiple version of Python installed. They just have to be added in your system PATH.

Pay attention that if you let all executables called "python", the latest in your path will be used. You can check this with the command

python --version

For Tensorflow, you can install it on Python 3.6. In my case I used Anaconda 4.4 with Python 3.6 but you can do it by your own.

NB : For tensorflow, pay attention to install CUDA8.0 and add CUDNN version 5.1 (not the version 6.0)

Upvotes: 1

Egal
Egal

Reputation: 1474

In general you can use virtualenv. Specifically for working with Tensorflow I'd suggest building an env with Anaconda.

Upvotes: 1

Related Questions