-
-
Notifications
You must be signed in to change notification settings - Fork 5.1k
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
DLL load error while importing scipy.sparse.linalg module on Windows #11062
Comments
That's because you haven't clicked add python to path box when you are installing python. Instead add libs to path |
Normally this should happen either at config or init lib stage, because I can't know in advance whether library uses DLLs or not. Hence, I propose to add aforementioned path settings to |
I think this has never come up, because there are many reasons you'll want to set |
We can't dictate where or how the python access should reside. I don't think we can do anything about it. It's beyond scipy's jurisdiction. |
We have a similar issue happening in |
That should be fixed in #10628 |
Just to make sure I understand correctly, a new PR needs to be created to modify the destination folder of the Similar to what was done here, but So, it can work seamlessly with numpy configuration tool: |
After switching to Python3.8 I can confirm its reproducibility. So I was wrong above. This is also affecting the numpy builds. My apologies for the quick and false response. I'll take this to NumPy maintainers. |
The problem I think is this: https://github.com/MacPython/scipy-wheels/blob/master/appveyor.yml#L167 We used a pinned version of numpy.distutils with the correct Windows patches, but for Python 3.8 this was changed to use Numpy upstream, which has a different name for the DLL directory. EDIT: somehow also the |
This is also happening on my local NumPy and SciPy builds. |
So there seem to be now several different issues: (i) MacPython/scipy-wheels#55 changed the pinned Numpy distutils version, which changed the name of the DLL directory. However, (ii) There is something strange with the behavior of
fail to change |
|
The |
That would be my guess too. I'll modify misc_utils manually and try to see the arguments. Maybe |
I think you can modify the The original bug report is also for Python 3.7, so I'm not sure behavior changes in 3.8 explain... |
Looks like |
Scipy library is installed with pip, hence python installer per se can't add any scipy DLL paths, it happens much later. Also, adding DLL permanently to the Path env variable in M$ Windoze might interfere with other scipy versions, being executed in virtual python environment. So, in my opinion, it would be way better to add |
It looks like we have two and a half problems intertwined as @pv mentioned. One for the wheels the naming issue and the other is explained by @mattip in the NumPy side that Py3.8 on Windows changed the way it searches for DLLs. Hence those will have an additional 3.8 if branch in the same place and the business will be as usual. For the wheels and NumPy side story is a bit more complicated. |
If it can help, we were experiencing the issue with Python 3.6.8 on Win64. |
The I'll try to backport that fix to |
NumPy fix in numpy/numpy#14923, should be taken over in the wheels repo I think. |
I don't get it---there's a comment from @ilayn in that PR indicating that this is a blocker for SciPy Python 3.8 wheels release but you let me proceed with the 1.3.3 release? Can we get a test in the wheels repo to produce this failure that persists even with hard-loading of DLLs from I thought I had this covered with usage of I suppose it might be cleaner to prefer a solution from upstream distutils, but is anything actually broken with the current approach of using |
I meant this is a blocker for 1.3.2 already on top of the remaining issues. I encountered it and also as you see above took me a while to verify it after we branched off. Because it specifically hits python 3.8/windows. I think only 3.8 wheels need to be updated and nothing else. |
What's the reproducer for SciPy
|
That's a very good question that I don't have a good answer to. Lately CIs are testing my faith in them. |
Alright, I'll try to test on Windows tonight. If I understand correctly you're saying this would remove the |
The actual question I have is that how come this doesn't conflict with the |
As far as this issue is concerned, the remaining question is the original Python 3.7 report for which the reporter did not yet provide requested additional information. It's probably some non-general issue (e.g. badly quoted system |
I think I just ran into this when creating a new dev environment with Python 3.8 in Windows. Build goes fine, but when I try to run tests or import a subpackage at the Python prompt, I get the DLL load error. No problem with Python 3.7. |
@mdhaber latest |
Latest master. |
Now that Python 3.7 support has been dropped (gh-14655), this is a bigger issue for me, as I can no longer work with SciPy from the master branch. I upgraded to Python 3.8,
Suggestions? |
Did you also install after build? Seems like you are in the github folder and trying to import scipy. It should search in the site-packages or whatever it was called and not in the source folder. Did you also add the python to the path by the way? |
I'm using conda, and I use |
Then it should look for it in the conda folders. Here the errors are coming from the source folders. Your workflow might be broken instead of the scipy since 3.8 changed the lookup for DLL mechanism. Can't say anything much about conda though never used it Obvious alternative is just skip 3.8 and jump to the 3.9 (or even 3.10?) wagon. |
I see. Wouldn't the workflow also be broken for everyone who follows the quickerstart guide, the mac quickstart guide, and the ubuntu quickstart guide (or adapts the Windows build instructions accordingly)? All of those use I'll try 3.9/3.10. |
Yeah I can't comment on the conda part but from the silence of this issue for quite some time, something is apparently specific to your use case. But unfortunately have no idea. The main issue when 3.8 came out was the DLL change but then things settled down. |
Thanks @ilyan. Hopefully someone else can help. I don't think I'm doing anything too unusual. I have conda installed, then my compilers are set up and OpenBLAS built according to the Windows build instructions. Then the following works to set up a new development environment. From the local repo:
SciPy builds successfully, and SciPy imports work. If I change the first line to:
(or a later version of Python), SciPy builds successfully, but I get the DLL load failures when I try to import a subpackage. |
This looks like an ana/mini/conda bug that is still open. I've got many google results about the same problem. Vanilla python is fixed but conda has still issues about this apparently. |
Huh. Is it worth trying to install python from a different conda channel? |
I don't think so there are many reports of the same issue such as this ContinuumIO/anaconda-issues#12475 |
Thanks for finding that. |
I thought I might as well try using conda-forge python, because that could be different from conda's default channel python and thus avoid the issue. But that doesn't work either. |
I thought this issue was long since solved. Note that there are two separate ones:
I believe (1) is solved, but (2) still seems to be a problem (because we didn't do anything to fix it, the changes we did make are specific to (1). @mdhaber to confirm: you did try |
I didn't know about |
@mdhaber can you check that that fixes it for both |
I set up two new environments. I installed
in each environment, and everything seemed fine. In both environments, I get the same error without Strangely (to me) it doesn't matter whether |
@mdhaber, can you try installing python39 using Also is there a way for me to get RDP access to a windows machine with this issue reproduced? |
I believe this issue can be closed now. We've transitioned to a new build system and we're not getting further comments on this issue. If you think that this issue should be reopened to add further details then please do so. |
My bug report is about DLL load error on running scipy-1.3.2 library for Windows 10 64bit
Reproducing code example:
After small research I've identified a culput, there is no PATH env setup for windows platform inside
__config__.py
of scipy package, or it's not get executed correctly.Henceforth, the path to .libs folder is not added to Windows path and libraries never ever gets found.
Error message:
Scipy/Numpy/Python version information:
Python 3.7.5 win64
scipy-1.3.2
numpy-1.17.4
Temporary workaround I'm using for the moment being, is a small update within
__init__.py
repeating the missing search path addition.The text was updated successfully, but these errors were encountered: