4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【Python】Tensorflow2.0がPython3.8に対応していなかったのでPythonをダウングレードした話

Last updated at Posted at 2020-10-28

#環境
Mac OS Catalina 10.15.7
Spyder 4.1.4
Anaconda 3
Python 3.8.3

#やったこと
TerminalでTensorflowをインストールしようとすると、下記のようなエラーが出ました。(2020/10/28現在)

(省略)
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:

Specifications:

  - tensorflow -> python[version='2.7.*|3.7.*|3.6.*|3.5.*']

Your python: python=3.8

If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
(省略)

TensorflowのサポートしているPythonのバージョンは3.7までだけど、あなたのは3.8ですよ。と教えてくれています。

というわけでこちらの記事を参考にさせていただきながら、Python3.7の仮想環境を作りました。
[環境構築 Python]

Anaconda NavigaterのEnviromentsにあるCreateボタンを押し、
 Name:python37
 Package:python3.7
で作成完了。
▶︎ボタンを押してTerminalを起動し、condaを更新

# condaの更新
conda update --all
conda update -n base conda

そしてtensorflowをインストール

conda install tensorflow

ちなみに、condaとpipを混同するのはあまり素敵じゃないようです。
[condaとpip:混ぜるな危険]

Spyderを起動して下記を入力して実行。無事importできました。

import tensorflow
4
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?