38,757
edits
No edit summary Tag: Manual revert |
(Updating to match new version of source page) Tags: Mobile edit Mobile web edit |
||
Line 602: | Line 602: | ||
Ceci est résolu avec l'installation d'une version précédente de Numpy avec <code>pip install --no-index 'numpy<1.24'</code>. | Ceci est résolu avec l'installation d'une version précédente de Numpy avec <code>pip install --no-index 'numpy<1.24'</code>. | ||
=== ModuleNotFoundError: No module named 'X' === | |||
When importing a Python module, it may not be found. Numerous reasons may explain this error but common cases are : | |||
* the package is not installed or not visible by the python interpreter; | |||
* not imported as it is named; | |||
* a broken virtual environment. | |||
In order to avoid these common cases, avoid: | |||
* modifying <code>PYTHONPATH</code> environment variable; | |||
* modifying <code>PATH</code> environment variable; | |||
* loading a module with a virtual env. activated (which in turn modifies the priors) | |||
To solve this, ensure that the above element did not interfere, then: | |||
* that the package is installed and named correctly (upper or lower case and underscores matters); run <code>pip list</code>; | |||
* that it is imported at the correct level (when importing from its source directory) | |||
In doubt, start from zero in a clean new environment. |