You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Add notes to ImportError for common issues #127598
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
I was also thinking to add the message for the cases where:
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
however, I'm not sure how to handle such cases, since these are options think mainly for safety reasons, is it safe to traverse the removed path on the traceback when such the ImportError happens?
Activity
ZeroIntensity commentedon Dec 4, 2024
Related: #125873
MonadChains commentedon Jul 19, 2025
Hi @FFY00 and @ZeroIntensity I open a mr to add some flavour text for this case:
gh-127598: Improve ModuleNotFoundError when -S is passed (GH-136821)
MonadChains commentedon Jul 24, 2025
I was also thinking to add the message for the cases where:
however, I'm not sure how to handle such cases, since these are options think mainly for safety reasons, is it safe to traverse the removed path on the traceback when such the
ImportErrorhappens?pythongh-127598: Improve ModuleNotFoundError when -S is passed (pytho…
pythongh-127598: Improve ModuleNotFoundError when -S is passed (pytho…