DLL load failed error in debug mode
I have inherited a code which uses different sub-packeges of the scikit-image library. To run the code I have created a new environment in conda (using python 3.12) and installed the necessary packages. Now when I run the code in PyCharm 2024.1.4, it runs fine but I get an ValueError. So naturally I try to run the script in debug mode, which leads to an DLL load error (full traceback of the error further down) while importing the subpackage io from skimage.
This is so confusing because both in Debug and in Run configuration the PATH variable is the same. I am aware of the similar issue PY-27234. Following the solution I have tried running print(os.environ['PATH'])
in the command window (same environment as I use for the code in pycharm) and copying the output and setting it as the PATH variable in the run and debug configuration, but it has not chaged anything. Interestingly, I can run from skimage import io
and some io functions like io.imread
in the command prompt without an error, so it must be the IDE.
Further trouble-shooting I've tried is: Looking for the _propack package which failed to load - it's in the right directory; Creating new environments in different python versions - same problem; Running the code in Spyder - same Error message. I am currently out of ideas and would highly appreciate some help.
Traceback (most recent call last):
File "C:\Users\XYMMEDUG\AppData\Local\Programs\PyCharm Community\plugins\python-ce\helpers\pydev\pydevd.py", line 1551, in _exec
pydev_imports.execfile(file, globals, locals) # execute the script
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\XYMMEDUG\AppData\Local\Programs\PyCharm Community\plugins\python-ce\helpers\pydev\_pydev_imps\_pydev_execfile.py", line 18, in execfile
exec(compile(contents+"\n", file, 'exec'), glob, loc)
File "G:\Organisation\SMT-DO\SMT-DOS\060_DOSI\20_Projekte\27_Partikelmikroskop\03_Auswertungsergebnisse\21_fehlertracking_skript\__particle_tracking_2von4.py", line 11, in <module>
from skimage import io, measure, exposure
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\lazy_loader\__init__.py", line 79, in __getattr__
return importlib.import_module(f"{package_name}.{name}")
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\importlib\__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\skimage\io\__init__.py", line 11, in <module>
from ._io import *
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\skimage\io\_io.py", line 8, in <module>
from ..color.colorconv import rgb2gray, rgba2rgb
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\skimage\color\colorconv.py", line 55, in <module>
from scipy import linalg
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\__init__.py", line 134, in __getattr__
return _importlib.import_module(f'scipy.{name}')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\importlib\__init__.py", line 90, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\linalg\__init__.py", line 222, in <module>
from ._sketches import *
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\linalg\_sketches.py", line 9, in <module>
from scipy.sparse import csc_matrix
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\sparse\__init__.py", line 308, in <module>
from . import csgraph
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\sparse\csgraph\__init__.py", line 185, in <module>
from ._laplacian import laplacian
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\sparse\csgraph\_laplacian.py", line 7, in <module>
from scipy.sparse.linalg import LinearOperator
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\sparse\linalg\__init__.py", line 132, in <module>
from ._eigen import *
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\sparse\linalg\_eigen\__init__.py", line 11, in <module>
from ._svds import svds
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\sparse\linalg\_eigen\_svds.py", line 9, in <module>
from scipy.sparse.linalg._svdp import _svdp
File "C:\ProgramData\Anaconda3\envs\env_312\Lib\site-packages\scipy\sparse\linalg\_svdp.py", line 24, in <module>
from ._propack import _spropack # type: ignore[attr-defined]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ImportError: DLL load failed while importing _spropack: Die angegebene Prozedur wurde nicht gefunden.
Please sign in to leave a comment.
Hi Medu Marko ,
As a general troubleshooting step, would you please try updating the recent version of PyCharm and check if the issue persists on it?
If so, would it be possible to share a minimal sample project representing the issue along with logs from Help | Collect Logs and Diagnostic Data after reproducing it? Please upload it to https://uploads.services.jetbrains.com and let me know the upload ID.
Hi, thank you very much for the reply. I updated Pycharm to 2024.1.6 without any effect.
Here is a minimal example, with Logs and Diagnostics Data after reproducing the error: 2024_08_12_h1JSv1rGoFSjPH89VZ7RW2. I have also added a YAML file of the environment I use.
Hi Medu Marko , thank you for the update!
For in-depth analysis, may I ask you to share the output from this script executed from the command prompt outside of IDE and from PyCharm (in debug mode) to compare the output?
Hi Mikhail,
I ran the script in the command prompt and here is the output:
In the PyCharm debugger I get the following output:
Thank you again for taking your time to work on this!
Best,
Marko