1

I am trying to use tensorflow but my python is to recent. I have python3.7.2 and I need py3.6 in order to install and use tensorflow.

I have installed py3.6.8 but I still can't install it with pip. Is there a way of interchanging between versions of python to install/use tensorflow. Or is it to do with my pip version?

The error is: Could not find version that satisfies the requirement tensorflow in versions:

The main problem is that I don't know how to get tensorflow. Can someone help me do this?

Meister96Fels
  • 508
  • 1
  • 8
  • 26
BOBTHEBUILDER
  • 345
  • 1
  • 4
  • 20
  • You could use your full python path to python 3.6.8 and add -m pip install xx in command line. This will use the pip module for the specific python installation you want to use. – Stef van der Zon Feb 11 '19 at 09:23
  • How is this related to [tag:cmd], the Windows Command Prompt? – aschipfl Feb 11 '19 at 15:42

2 Answers2

1

Option 1: Install multiple versions in separate directories, and then you run the python program with the Python version you want to use. Like so:

C:\Python26\Python.exe thescript.py

What virtualenv does is that it gives you many separate "virtual" installations of the same python version. That's a completely different issue, and hence it will not help you in any way.

Option 2:

Use Pythonbrew.

Once pythonbrew is installed:

#to install new python versions is as simple as:
pythonbrew install 2.7.2 3.2
#to use a particular version in the current shell:
pythonbrew use 3.2
#to uninstall:
pythonbrew uninstall 2.7.2
Mebin Joe
  • 2,172
  • 4
  • 16
  • 22
  • You can have multiple Python versions with pip, see https://stackoverflow.com/questions/2812520/pip-dealing-with-multiple-python-versions Another option comes with Anaconda (see my answer). – Lukasz Tracewski Feb 11 '19 at 10:16
1

By far the best option will be to use Anaconda virtual environment. After you install Anaconda, use environments to manage different versions of Python:

Python 3.6.8:

conda create -n myenv python=3.6.8 tensorflow

Python 3.7:

conda create -n myenv python=3.7 tensorflow

Why am I saying it's best with Anaconda? Long story short, it can be (much) faster. Here's an article that discusses why.

Lukasz Tracewski
  • 10,794
  • 3
  • 34
  • 53