lsdnts
December 7, 2022, 5:41pm
1
Hey,
They changed the machines from where I work and I’m installing everything again. But I’m having trouble with matplotlib, it installs ok (installed through pip) but when I run the script it raises this error:
from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found
I tried updating matplot and uninstalling and reinstalling it, but it didn’t work.
I’m using python 3.11.0 and windows 11.
Unfortunately based on this information it is very hard to provide useful advice.
I would check to make sure that the Python you ran pip
with and the Python you ran your script with is the same Python.
I strongly suggest using conda (and the conda-forge channel) to provide a coherent environment.
QuLogic
February 22, 2023, 9:06pm
4
This looks like it is related to:
opened 02:40PM - 12 Dec 22 UTC
closed 05:20AM - 20 Dec 22 UTC
OS: Microsoft
### Bug summary
`import`ing matplotlib on a fresh Windows machine or containe… r fails with the following traceback:
```
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python\lib\site-packages\matplotlib\__init__.py", line 113, in <module>
from . import _api, _version, cbook, _docstring, rcsetup
File "C:\Python\lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
from matplotlib.colors import Colormap, is_color_like
File "C:\Python\lib\site-packages\matplotlib\colors.py", line 56, in <module>
from matplotlib import _api, _cm, cbook, scale
File "C:\Python\lib\site-packages\matplotlib\scale.py", line 22, in <module>
from matplotlib.ticker import (
File "C:\Python\lib\site-packages\matplotlib\ticker.py", line 138, in <module>
from matplotlib import transforms as mtransforms
File "C:\Python\lib\site-packages\matplotlib\transforms.py", line 49, in <module>
from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.
```
AFAIK, the DLL that's being called for isn't displayed here but I suspect this is something from the MSVC runtime.
### Code for reproduction
```
docker run -it python:3.11.1-windowsservercore-1809 powershell
pip install matplotlib
python
import matplotlib
```
### Actual outcome
```
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python\lib\site-packages\matplotlib\__init__.py", line 113, in <module>
from . import _api, _version, cbook, _docstring, rcsetup
File "C:\Python\lib\site-packages\matplotlib\rcsetup.py", line 27, in <module>
from matplotlib.colors import Colormap, is_color_like
File "C:\Python\lib\site-packages\matplotlib\colors.py", line 56, in <module>
from matplotlib import _api, _cm, cbook, scale
File "C:\Python\lib\site-packages\matplotlib\scale.py", line 22, in <module>
from matplotlib.ticker import (
File "C:\Python\lib\site-packages\matplotlib\ticker.py", line 138, in <module>
from matplotlib import transforms as mtransforms
File "C:\Python\lib\site-packages\matplotlib\transforms.py", line 49, in <module>
from matplotlib._path import (
ImportError: DLL load failed while importing _path: The specified module could not be found.
```
### Expected outcome
matplotlib imports without errors.
### Additional information
I _think_ the MSVC runtime is currently a dependency of matplotlib and the required DLL should be distributed with the wheel. If I run `pip install msvc-runtime` the import works, maybe that package or something like it could be a transient OS-specific dependency.
### Operating system
Windows 10
### Matplotlib Version
Import fails (3.6.2, 3.6.1, 3.6.0)
### Matplotlib Backend
Unknown, import fails
### Python version
3.11.1
### Jupyter version
N/A
### Installation
pip
and it should be fixed in 3.7.0.