-
Notifications
You must be signed in to change notification settings - Fork 2.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
Importing example project fails on fresh Windows 7 installation #1083
Comments
Have you read the FAQ? It seems to answer one of your questions: http://pybind11.readthedocs.io/en/master/faq.html#working-with-ancient-visual-studio-2009-builds-on-windows And, if you are on Windows, I would recommend Python 3 if possible! :) |
Ah, damn, no, I had missed that! That does mostly solve the second part of my question, indeed. The first part, with the Also, on the Python 3 suggestion: it's not just me. Distributing my package on PyPI, I would prefer to still offer Python 2... |
Ahh, libraries, yes 2.7 still is needed there. 😞 . And I think you have to either ask for the redistributable library to be downloaded, or you can redistribute it (probably can't be done on PyPI, though). Someone else might know more, though, I've not used Windows (save for AppVeyor) in several years... I wonder if the error message could be made more helpful? |
Yes, that's why I'm asking, indeed. I prefer to stay away from Windows as well, but quite a lot of my user base might not think the same :-( And even if there's no better way, we could/should probably add something to the documentation about this redistributable. The error message is Python forwarding Windows' error message, I think. Just guessing, but |
Also, what about this whole thing with setting Is that also unnecessary when using the latest MSVC version? |
From your end, if you provide a pure Python wrapper you can. I call the module |
Hmmm, true, I could keep that in mind. Thanks for the idea! (Might still be messy to catch the exact right errors, and not all the |
Let me close my own issue as well. Thanks for the help, back then, @henryiii! For future reference, I ended up just making a note in my docs:
|
The
cmake_example
project fails to be imported on a fresh Windows 7 installation, throwing the immensely informative exceptionImportError: DLL load failed: The specified module could not be found.
Upon further inspection, using the depends tool for Window DLLs, it seems that this is because
MSVCP140.DLL
cannot be found. As far as I know, this is MSVC's C++ standard library. Is there a way to get around this, or is the only way to solve it to tell users to install the C++ redistributable libraries?Next to that, while investigating and reading up on this issue, I found that to build a binary Python extension, developers are urged to make sure the standard library DLLs that are linked against to be the same as the ones the official Python was built against (e.g., https://matthew-brett.github.io/pydagogue/python_msvc.html, or http://stevedower.id.au/blog/building-for-python-3-5/). I however found that the pybind11 examples were referencing the VS 2015 DLL,
VCRUNTIME140.DLL
(as they were built on AppVeyor with VS 2015). Next to that, the issue with using the offical compiler Microsoft released to ensure compatibility with Python 2.7 (https://www.microsoft.com/en-us/download/details.aspx?id=44266) is so old that it doesn't support C++11. Any thoughts/reassurances on this? Will the Python extensions that I build this way work, even when I would start using more advanced features of the C/C++ standard libraries that have changed between different DLL versions?Additional links:
The text was updated successfully, but these errors were encountered: