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?
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?
I was having trouble installing tensorflow with python 3.7 and followed these instructions to have a virtual environment setup with python3.6 and got it working
setting up python3.6 virtual environment for tensorflow
If you are using jupyter notebook or jupyter lab this can be helpful to choose the right virtual environment
At this point, you can start jupyter, create a new notebook and select the kernel that lives inside your environment.
virtual environment and jupyter notebooks
Hope this helps
Create a python virtual environment using conda, and then install the tensorflow:
From now on, you can activate the environment whenever you want to use tensorflow.
If you don't have the conda package manager, first download it from here: https://www.anaconda.com/distribution
create a virtual environment, install then switch to python 3.6.5
activate the environment when you would want to use tensorflow
If you are working with Anaconda, then
might work.
A clean way without having to uninstall a previous version or reverting to additional software like Anaconda or docker, etc. is to download the Python 3.6 source code and install it as follows:
To use it you either:
add
/home/<user>/python3.6/bin
to yourPATH
(andlib
toLD_LIBRARY_PATH
) and be done with it. (You may also need to add to your include path etc., depending on what you're trying to achieve exactly - but you get the idea, I hope.);or, you create a virtual environment similar to this:
/home/<user>/python3.6/bin/python3.6 -m venv env-python3.6
.No sudo or root access required. No messing up your system.