I have a compiled .pyd module that relies on several other DLLs (Python mapscript and MapServer) and I'm trying to use it in IPython on Windows 10. Set up steps are as follows:
- Created a new virtual environment
- installed mapscript to the environment
- set the PATH to include the folder containing the MapServer DLLs
- the "import mapscript" works fine when run using the standard venv Python
- when starting ipython and running "import mapscript" I get the following error:
ImportError: DLL load failed: The specified procedure could not be found.
Debugging steps so far:
- sys.executable is identical in both cases (venv Python and venv IPython)
- os.environ["PATH"] is identical
- sys.path in ipython has a couple of extra paths in IPython at the end -
C:\Users\user\.ipython
and 'c:\virtualenvs\mapscript-jupyter3\lib\site-packages\IPython\extensions' but are otherwise identical. Removing these paths does not change the error. - I've tried finding a missing DLL using Process Monitor but they all seem to be found.
The same issue occurs in both Python 2.7 and Python 3.6 with newly created venvs. The issue seems to be the opposite of ipython notebook can import a pyd module but the python interpter can't
So my question is what does IPython do to the Python environment that can cause differences to standard Python and cause the ImportError?