Mac Catalina, pyenv 環境下 Python 3.8.1  を使っている。

tensorflow のインストールメモを残しておく。

 

 

pip install tensorflow

 

とすると

 

ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)

ERROR: No matching distribution found for tensorflow

 

というエラーが出てインストールできない。バージョンを指定しないといけないのだろうか。

いろいろ調べたところ

 

pip install --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.14.0-py3-none-any.whl

 

で無事成功した。

tensorflow のバージョンは

 

https://www.tensorflow.org/versions

 

に一覧があるが、2019/12/30 の時点で、

https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.15.0-py3-none-any.whl

とか

https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-2.0.0-py3-none-any.whl

は、 does not exist でインストールできなかったのだが、何か方法があるのだろうか。

 

ネットで調べると virtualenv を使う方法がよく出てくるが、必須ではなく、今回は使っていない。

 

 


 

pip install でバージョン指定するには

 

pip install tensorflow==1.14.0 

 

で良いようだ。(zsh でこれをするとエラーがでるという話しも、どこかに書いてあったので注意が必要かも)

tensorflow のインストール方法をいろいろ試しているときに、v1 の最新版の 1.15.0 をインストールしようと、

 

pip install tensorflow==1.15.0 

 

としたところ

 

ERROR: Could not find a version that satisfies the requirement tensorflow==1.15.0 (from versions: none)

ERROR: No matching distribution found for tensorflow==1.15.0

 

というエラーが出たため、この方法は続けなかったのだが
 

pip install tensorflow==1.14.0 

 

でOKだったっぽい。
 

 
python 3.7.6 で試したところ
 
pip install tensorflow 
 
で普通に v2.0.0 のインストールが完了した。