pip install で「No matching distribution found」が出てインストールできない
要求バージョンが PyPI に無い、現在の Python / OS / アーキ向けの wheel が無い、社内ミラー側に同期されていない、のいずれかが原因。
pip index と pip debug で実在バージョンとサポート tag を確認する。
公開: 更新:
要約
ERROR: Could not find a version that satisfies the requirement No matching distribution found は、pip が ターゲット環境に合う配布物(wheel / sdist)を見つけられなかった ことを意味する。
バージョン指定の誤り、Python / OS / アーキ向け wheel の不在、ミラーの同期遅れ、を順に切り分ける。
よくある原因
- バージョン誤指定:
==1.99.0のように存在しないバージョンを指定している、または yank された版を要求している - プラットフォーム不一致: 現在の Python マイナーバージョン / OS / アーキ向けの wheel が公開されていない(M1 Mac で x86_64 のみ、など)
- ミラーの同期遅れ: 社内 PyPI に新版がまだ届いていない
- sdist のみ: wheel が無く
.tar.gzだけのパッケージで、コンパイラ不在のためビルドできない
解決策
1. 公開バージョンを確認
pip index versions requests
# requests (2.32.3)
# Available versions: 2.32.3, 2.32.2, ...pip index versions で実在バージョンを取得できる(公式 pip install ドキュメント(新しいタブで開く) 参照)。
誤指定なら直す。
2. ターゲット tag を確認
pip debug --verbose
# Compatible tags: ...
# cp311-cp311-manylinux2014_x86_64
# ...ここに出る tag に合致する wheel が PyPI 上に無ければ、現在の Python では入らない。
Python のマイナーバージョンを wheel が出ているものに揃える。
詳細は pip debug の公式ドキュメント(新しいタブで開く) を参照。
3. 本家 PyPI で再検証
pip install --index-url https://pypi.org/simple <pkg>社内ミラー経由で失敗するときは本家を直接叩いてみる。
本家で成功すれば ミラー側の同期遅れ と切り分けられる。
4. sdist しか無いパッケージ
# C 拡張を含むなら
sudo apt-get install build-essential python3-dev
# Rust 拡張なら
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
pip install <pkg>No matching distribution の代わりに途中まで進んでビルド失敗に変わる場合は、必要なツールチェインを入れる。
実行例
実際に上記の手順を python:3.12(Debian GNU/Linux 13)環境で動かすと、存在しないパッケージ名を指定した場合に ERROR: Could not find a version that satisfies the requirement と ERROR: No matching distribution found の両エラーが終了コード 1 で出力され、pip index versions で実在バージョンを確認して正しいパッケージ名に修正することで終了コード 0 に解消されることが確認できる。
$ pip install this-package-surely-does-not-exist-xyz123
ERROR: Could not find a version that satisfies the requirement this-package-surely-does-not-exist-xyz123 (from versions: none)
ERROR: No matching distribution found for this-package-surely-does-not-exist-xyz123
pip の終了コード: 1$ pip index versions six
six (1.17.0)
Available versions: 1.17.0, 1.16.0, 1.15.0, 1.14.0, 1.13.0, 1.12.0, 1.11.0, 1.10.0, 1.9.0, 1.8.0, 1.7.3, 1.7.2, 1.7.1, 1.7.0, 1.6.1, 1.6.0, 1.5.2, 1.5.1, 1.5.0, 1.4.1, 1.4.0, 1.3.0, 1.2.0, 1.1.0, 1.0.0, 0.9.2, 0.9.1, 0.9.0$ pip install --quiet six$ python -c "import six; print('six version:', six.__version__)"
six version: 1.17.0
終了コード: 0(0 なら解消)— 2026-08-02 時点の出力