How do I resolve Python ImportError when using a Python Extension Module in a Debug configuration?
I am trying to run a "Python Application" template project that uses a "Python Extension Module" template project. I am using the default configuration settings for these projects. Everything works great in a Release configuration, but the Debug configuration is giving me errors. When I run the python application, I get the following error:
ImportError('DLL load failed: The specified module could not be found.')
The exact steps I am taking for this are as follows:
- Create a new solution.
- Add a new "Python Extension Module" project from the templates list, named "module1".
- Add a new "Python Application" project from the templates list, named "PythonApplication1".
- Add a reference to "module1" from "PythonApplication1".
- In the file "PythonApplication1.py", add the line "import module1". For the Debug configuration, it appears this should be "import module1_d", which I have also tried.
- Build the solution.
- Set "PythonApplication1" to be the startup project and "PythonApplication1.py" to be the startup file.
- Start debugging.
As I said above, these steps work perfectly for a Release configuration and there is no error, but for a Debug configuration it errors out. My goal is to have the full capabilities of the IDE for debugging that a Debug configuration typically provides for C/C++ code, so I would love to get some help for this issue.