Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add notes to ImportError for common issues #127598

Open
5 tasks
FFY00 opened this issue Dec 4, 2024 · 1 comment
Open
5 tasks

Add notes to ImportError for common issues #127598

FFY00 opened this issue Dec 4, 2024 · 1 comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-importlib type-feature A feature request or enhancement

Comments

@FFY00
Copy link
Member

FFY00 commented Dec 4, 2024

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
  • Failing to import a non-stdlib module with the site initialization disabled (-S)
  • Failing to import a module available in the user site-packages with the user site initialization disabled (-s)
  • Failing to import a module available in . with PYTHONSAFEPATH/-P enabled
  • Failing to import a module when ignoring PYTHON* environment variables (-E) but PYTHONPATH or PYTHONHOME are 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

@FFY00 FFY00 added the type-feature A feature request or enhancement label Dec 4, 2024
@ZeroIntensity
Copy link
Member

Failing to import a module when ignore PYTHON* environment variables (-E) but PYTHONPATH or PYTHONHOME are set (which users might be relying on)

Related: #125873

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
interpreter-core (Objects, Python, Grammar, and Parser dirs) topic-importlib type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

4 participants