How to Downgrade Python from 3.7 to 3.6
I'm Trying to Install Tensorflow but It Needs a Python 3.6 Installation and I Only Have Python 3.7 Installed. I Tried to Switch Using Brew and Pyenv but It...
I'm trying to install tensorflow but it needs a Python 3.6 installation and I only have Python 3.7 installed. I tried to switch using brew and pyenv but it doesn't work.
Does anyone know of a way to solve this problem?
15 Answers
$ brew unlink python
$ brew install --ignore-dependencies
$ brew switch python 3.6.5
$ pip install tensorflow
Here is a canonical summary which sums up different solutions for the variety of operating system Python runs on. What follows are possibilities for Microsoft Windows, Linux, macOS and Misc.
As mentioned those are just possibilities - by no means do I claim to have a complete list whatsoever.
Microsoft Windows
Option 1
In general, it's suggested to use virtual environments (I highly suggest looking at the official Python documentation). With this approach, you easily can set up project-specific Python versions (as well as libraries). Easily manageable and the best part: There are lots of tutorials on the internet on how to approach this:
1.) Open command prompt ("cmd") and enter pip install virtualenv.
2.) Install your desired Python version via Remember: Do not add to PATH!
3.) Type into the command prompt: virtualenv \path\to\env -p \path\to\python_install.exe, whereas \path\to\env shall be the path where your virtual environment is going to be and \path\to\python_install.exe the one where your freshly (presumably) installed Python version resides.
4.) Done! You now have a virtual environment set up! Now, to activate the virtual environment execute the batch file which is located inside the \path\to\env\Scripts\activate.bat. (cf. this website or an official Python guide)