-
Notifications
You must be signed in to change notification settings - Fork 56
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
Windows 10 x64 ImportError: DLL load failed - location issue or binary compatibility issue? #52
Comments
Thanks for the nice error report. I don't think that other successful builds have been using the official Python. It seems most have been using Anaconda/Conda based Pythons.
Could be. I recommend investigating the ipopt documentation, etc., for the answer. |
Adding some further debugging information (not a final solution):
|
We do not build cyipopt with mingw on appveyor, we use Microsoft's compiler. I think the only difference in your build would be that you are using Python.org's Python and we use Anaconda.org's. |
Here is the relevant call to the compiler on appveyor:
|
I can't test for now, but this might be due to the fact that you seem to be using x86 VS2019 build tools, whereas your Python version is x64, same as the Ipopt dll. |
@apommel Thanks for your reply.
Thanks for your comment. Over the next couple of days I will try to (in order)
|
The appveyor builds can be found here: https://ci.appveyor.com/project/moorepants/cyipopt Note that we are not compiling Ipopt ourselves on appveyor, we simply download the prebuild ipopt binaries. |
@avikde
All in all, I would advise you to try with Anaconda, and give your feedback about that. You can actually install it in a pretty unintrusive way by unchecking the options |
Just tried a few more steps with miniconda: recording all the steps here:
I am not sure which C compiler the people who had success were using, but I believe perhaps that is the problem. I looked into compiling ipopt but it seems quite involved... https://coin-or.github.io/Ipopt/INSTALL.html. BTW, this isn't directly relevant, but I also use Julia and IPOPT.jl installs and works without any hassle. I wonder if they compile Ipopt from source (probably using clang, if so). EDIT: To respond to your question about my packages on official python, normally I install my python packages from wheels here https://www.lfd.uci.edu/~gohlke/pythonlibs/ - numpy comes with mkl for instance, and all the installs are super fast. |
If you are using conda, you should install the dependencies with conda, not pip. |
These are the relevant conda commands we are using to build cyipopt on windows on appveyor:
Note that we are installing binaries from conda-forge as the primary channel and we install mkl. |
Also, note that you are in uncharted territory, as we do not have a working Windows build for the official Python distribution. If you want to build compatible binaries with Chris Gohlke's binaries, you need to match his build process. We only have a conda based build working on Windows here because it is non-trivial to build IPOPT on Windows and non-trivial to build cyipopt. Your Julia installs work because someone has taken the time and effort to build compatible binaries of IPOPT and Julia for Windows. We are very close to having |
Thanks a lot, Jason. After following the steps you listed in #52 (comment), python setup.py install worked, and so did import ipopt. I think it would be great to list those steps in the README (unless they are there and I missed them). |
Great! Maybe you'd like to submit a pull request to add instructions for installing on Windows? Theoretically only these two commands would be needed after downloading and extracting the IPOPT dlls:
|
The instructions are here: https://github.com/matthias-k/cyipopt#from-source-on-windows But maybe need a little improvement. |
System info:
Microsoft (R) C/C++ Optimizing Compiler Version 19.21.27702.2 for x86
)Steps taken:
...Finished processing dependencies for ipopt==0.2.0.dev0
import ipopt
printsDebugging so far:
The text was updated successfully, but these errors were encountered: