1
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 1 year has passed since last update.

tensorflowがインストールできないだと!?

Last updated at Posted at 2022-08-29

文字認識を自作しよう!

と意気込んだものの、初っ端から「tensorflow」がインストールできないという事態にはまったので、脱出策としての記録を残します。

脱出ということで、これを聴きながら
https://www.youtube.com/watch?v=GG5sv3iKlDw

はまったこと

発生エラーは下記のようなものでした

エラー内容.txt
pip install tensorflow
>>>ERROR: Could not find a version that satisfies the requirement tensorflow
>>>ERROR: No matching distribution found for tensorflow

端的にいえば、PCに入っている「python」のバージョンが「tensorflow」ライブラリに対応していなかったということ。
そんなことって、あるの!?

と思いましたが、「python」のバージョンは「3.7.2」でした。

現時点の最新版は「3.11」であり、「tensorflow」ライブラリは、大体3世代くらいが公開されてインストールできるようになっているぽいです

現時点でいえば、ざっくり「3.8 ~ 3.10」の間とか。

ただし、最新すぎても同様に「tensorflow」ライブラリに対応していない場合もあるので、ここはひとつ「3.9」をインストールすることにしました。

Pythonのインストール

公式サイトよりインストーラをダウンロードし、インストールも実施!
https://www.python.org/downloads/

インストール時に「パスの追加」みたいなチェックを入れ忘れた気がしてけど、まぁ大丈夫っしょ。
気持ちを新たに「pip」コマンドをと。

・・・。

あれ、同じエラーじゃないの。

エラー内容.txt
pip install tensorflow
>>>ERROR: Could not find a version that satisfies the requirement tensorflow
>>>ERROR: No matching distribution found for tensorflow

pythonのバージョンを確認すると「3.7.2」のまま。

パスの追加

これは忘れないようにしないとだめでした。

インストール時の指定を忘れたので、下記の2つを手動でPathに追加(3.9が3.7よりも上にくるように設定)

image.png

これにより、無事に「tesorflow」がインストールできました。

1
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
1
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?