-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
[Bug]: ImportError: DLL load failed while importing _path in conda development installation #27266
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
Comments
What pip command did you use? Note that it recently changed. https://matplotlib.org/devdocs/devel/contribute.html#workflow-overview |
I used
so the same as you linked, except for the |
Can you run Dependency Walker on the DLL to find out which runtime DLL is missing? Though it seems to be complaining about a missing symbol instead. |
@QuLogic I'm happy to do that but I'm unsure which file to run it on and what to look for. Do I use the GUI or the command line (how?) and post the output here? Where do I find the relevant DLL to run on? |
Using the editable install, it should be in You might also be able to run |
Out of curiosity, do you get the same error when you try to import Matplotlib outside the repo? |
Ok, I did that. I got
and in the module list I got
for each of the following files (sorry, long list):
Here's the output:
|
Yes, same thing. |
This extension was compiled with |
No, I used I did try it with MSVC instead now and that seems to work. But reading about the build dependencies again it still seems to me that
I do not have Strawberry Perl installed, no. (Though it is possible that I did in the past; I'm not sure. Could that still cause problems?) |
You have understood correctly; it should be allowed, but I don't think it has been tested or confirmed to work. But that's why we don't pass Since the imports seem to list some MSYS2 DLLs, but Dependency Walker can't find them, I think you would need to ensure your MSYS2 DLL directories are in your You might also be able to pass |
Ok, thanks for all of your pointers. I think I will stick with MSVC for now, as that seems to work. Feel free to close this issue or leave it open if you want to do something about this on your end. I'm happy to help by testing but I fear that I can't be much help other than that. |
I'm experiencing a similar error on NixOS:
Where as:
Gives a non-empty result. I also tried to run |
I'm going to close this as the original issues seems to be coming from a mixed build chain (mingw gcc + conda). @doronbehar I suspect you have a very different problem. I would first try |
I suspect it is a similar issue, because it may be related to building matplotlib slightly different then how you are used to do it and how you recommend doing it in your docs (on NixOS I just don't have a choice). More details are in this discourse thread: |
Bug summary
I want to set up a development installation of
matplotlib
following the instructions here. I am on Windows 11 usingconda
andgcc
from MSYS2. I did a freshgit clone
, created theconda
environment and successfully installedmatplotlib
usingpip
, as instructed. However, when I try to import it, I get the following error:(mpl-dev) d:\Projekte\miscellaneous_git_repos\matplotlib>python Python 3.11.6 | packaged by conda-forge | (main, Oct 3 2023, 10:29:11) [MSC v.1935 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import matplotlib Traceback (most recent call last): File "<stdin>", line 1, in <module> File "D:\Projekte\miscellaneous_git_repos\matplotlib\lib\matplotlib\__init__.py", line 161, in <module> from . import _api, _version, cbook, _docstring, rcsetup File "D:\Projekte\miscellaneous_git_repos\matplotlib\lib\matplotlib\rcsetup.py", line 27, in <module> from matplotlib.colors import Colormap, is_color_like File "D:\Projekte\miscellaneous_git_repos\matplotlib\lib\matplotlib\colors.py", line 57, in <module> from matplotlib import _api, _cm, cbook, scale File "D:\Projekte\miscellaneous_git_repos\matplotlib\lib\matplotlib\scale.py", line 22, in <module> from matplotlib.ticker import ( File "D:\Projekte\miscellaneous_git_repos\matplotlib\lib\matplotlib\ticker.py", line 143, in <module> from matplotlib import transforms as mtransforms File "D:\Projekte\miscellaneous_git_repos\matplotlib\lib\matplotlib\transforms.py", line 49, in <module> from matplotlib._path import ( ImportError: DLL load failed while importing _path: The specified procedure could not be found.
I found a couple of issues with similar problems on here, but those seemed to be resolved by using a newer version of Python or of Matplotlib, both of which I am already doing (relative to those issues).
I also found allusions that I might need some MSVC installation for the
dll
, though it is unclear to me how to check that. I have the Visual C++ Redistributables 2010, 2012, 2013, 2015-2019, and 2017 installed from other applications, though, so I assume that I am fine on that front.Code for reproduction
Actual outcome
Error (see above).
Expected outcome
No error.
(Sorry about the redundancy, I could not quite make this issue fit the template..)
Additional information
No response
Operating system
Windows 11
Matplotlib Version
3.9.0
Matplotlib Backend
No response
Python version
3.11.6
Jupyter version
No response
Installation
None
The text was updated successfully, but these errors were encountered: