Closed3
ERROR: No matching distribution found for tensorflow==2.10.0の対処

環境
- macOS Monterey
- Apple M1 Pro
# pyはpython3のエイリアス
$ py --version
Python 3.8.9
$ pip --version
pip 22.3 from /Users/xxxxxxxx/Library/Python/3.8/lib/python/site-packages/pip (python 3.8)
概要
pip install -r requirements.txt
を実行したところ、タイトルにある様なエラーが発生。出力全文は以下。
Defaulting to user installation because normal site-packages is not writeable
Collecting tensorboard==2.10.1
Using cached tensorboard-2.10.1-py3-none-any.whl (5.9 MB)
Collecting tensorboard-data-server==0.6.1
Using cached tensorboard_data_server-0.6.1-py3-none-any.whl (2.4 kB)
Collecting tensorboard-plugin-wit==1.8.1
Using cached tensorboard_plugin_wit-1.8.1-py3-none-any.whl (781 kB)
ERROR: Could not find a version that satisfies the requirement tensorflow==2.10.0 (from versions: none)
ERROR: No matching distribution found for tensorflow==2.10.0

これによれば、python 3.6 ~ 3.9, pip 19.0以降とのことなので、バージョンは問題なさそう。

ローカル環境ではなく、Dockerコンテナ上ではpython -m pip install tensorflow
が正常終了したので、環境差異によるためと考えられる。
ローカル環境で実施すべき理由もないため、一旦Dockerコンテナ上での実行ができるような状態を作ることとする。
参考)dockerで簡易にpython3の環境を作ってみる
Dockerfile
FROM python:3.8
USER root
RUN apt-get update
RUN apt-get -y install locales && \
localedef -f UTF-8 -i ja_JP ja_JP.UTF-8
ENV LANG ja_JP.UTF-8
ENV LANGUAGE ja_JP:ja
ENV LC_ALL ja_JP.UTF-8
ENV TZ JST-9
ENV TERM xterm
docker-compose.yml
version: '3'
services:
python3:
restart: always
build: .
container_name: 'python3'
working_dir: '/root/'
tty: true
volumes:
- ./opt:/root/opt
$ docker compose exec python3 bash
# inside container
$ python --version
Python 3.8.15
$ python -m pip install tensorflow
$ pip list
# 他のモジュールは省略
tensorflow 2.10.0
このスクラップは2023/01/11にクローズされました