Add notes to `ImportError` for common issues
オープン
まだ誰も着手していません。
interpreter-core
topic-importlib
type-feature
- 主要言語
- Python
- スター
- 77.2k
- フォーク
- 36k
- PR マージ指標
- PR 指標を取得中
説明
Feature or enhancement
Proposal:
ImportErrors are very common, and almost always dependent on the interpreter initialization and/or environment setup. There are many common issues we could try to detect, and give users hints on the possible cause.
- Failing to load native modules when a module for a different ABI is available
- Eg. https://github.com/python/cpython/issues/127294#issuecomment-2501787837
- A
.cp313t-win_amd64.pydmodule is available, but we were looking for.cp313-win_amd64.pyd
- A
- Eg. https://github.com/python/cpython/issues/127294#issuecomment-2501787837
- Failing to import a non-stdlib module with the
siteinitialization disabled (-S) - Failing to import a module available in the user site-packages with the user
siteinitialization disabled (-s) - Failing to import a module available in
.withPYTHONSAFEPATH/-Penabled - Failing to import a module when ignoring
PYTHON*environment variables (-E) butPYTHONPATHorPYTHONHOMEare set (which users might be relying on) - (suggest more!)
Has this already been discussed elsewhere?
No response given
Links to previous discussion of this feature:
No response
Linked PRs
- gh-136817
- gh-136821
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
Issue にはソースファイルやテストが記載されていません。まずリンクされている PR gh-136817 と gh-136821 を確認し、その後、選択した環境ケースに関係する ImportError の処理を追跡してください。合意したケースについて役立つ注記を追加してテストすれば完了です。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- python
- 領域
- developer-experience
- issue の種類
- 機能追加
- 難易度
- 4/5
- 見積もり時間
- 3〜5日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 25/100