This time, I would like to install TensorFlow 1.14.0 in order to use Keras-RL, a framework for reinforcement learning.
For reporting installation
terminal
$ pip install tensorflow
When specifying the version
terminal
$ pip install tensorflow==1.14.0
However, the following error may occur.
terminal
$ pip install tensorflow==1.14.0
Collecting tensorflow
Could not find a version that satisfies the requirement tensorflow (from versions: )
No matching distribution found for tensorflow
I dealt with it while looking at TensorFlow official website, but in my case I could not solve it ... (Image distribution seems to be only TensorFLow 2.X ...?) There are restrictions on the Python version depending on the version of TensorFlow, so let's check.
I was able to solve it with the following two.
terminal
$ pip3 install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl
pyenv is a command line tool that uses multiple versions of Python, such as Ruby's rbenv and NodeJS's nvm. It seems that the person who made this is Japanese, which is amazing. If you use this, you can decide the python version in detail for each case, so it is very convenient to use.
You can refer to this article for installing pyenv.
Building a Python environment on a Mac using pyenv
Try installing Python 3.7 for TensorFlow 1.14 with pyenv.
terminal
$ pyenv install 3.7.2
Next, install TensorFlow with pip.
terminal
pip install tensorflow==1.14.0
You have successfully installed it.
Recommended Posts