ImportError: DLL load failed: The specified procedure could not be found.

Answered

 This is similar but different to the other DLL load failed issues.

When I run PyCharm and try to import a library as follows

from PyQt5.Qt3DCore import QEntity
Traceback (most recent call last):
  File "C:\Program Files\JetBrains\PyCharm 2017.1.7\helpers\pydev\_pydevd_bundle\pydevd_exec2.py", line 3, in Exec
    exec(exp, global_vars, local_vars)
  File "<input>", line 1, in <module>
  File "C:\Program Files\JetBrains\PyCharm 2017.1.7\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: The specified procedure could not be found.

Yet when I run the command form a python console (started within PyCharm) I get no errors.

If I run Python in a command window it also works!

I've been pulling my hair out on this one.

Does anyone know how the module loader is searching for the DLLs? An which DLLs is it searching for?

Why does the python console work but neither the debugger nor the running program works within PyCharm! 

 

7 comments
Comment actions Permalink

Hi Pat, could you please check import os; print(os.environ['PATH']) in the console and in run/debug? Are there any differences?

0
Comment actions Permalink

Could you please enable Settings | Tools | Python Scientific | Show plots in toolwindow option? Has it helped to prevent an exception?

0
Comment actions Permalink

 I had a similar problem which I resolved actually by turning off Settings | Tools | Python Scientific | Show plots in toolwindow

0
Comment actions Permalink

The corresponding ticket in the bug tracker for future references: PY-27234.

0
Comment actions Permalink

@pavel karateev I installed tensorflow in pycharm (i went to settings,project interpreter and clicked on the plus sign) after installing tensor flow,I can't import it but I can import numpy. I get some errors that says "dll load failed" and "failed to load the native tensorflow runtime". Please what do i need to do. Note: i did not install anaconda in my pc.

0
Comment actions Permalink

Would you kindly try 2019.1 EAP build? At least DLL error should be fixed there if you are using conda.

0
Comment actions Permalink

I get a similar error when running in debug mode, but not in release mode in PyCharm 2019.2

import os
print(os.environ['PATH'])
from PyQt5 import QtGui

Runs fine with "Run" from PyCharm, but fails with "Debug".

>>> from PyQt5 import QtGui
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2.1\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: DLL load failed: The specified procedure could not be found.

 

The key difference is the path in the debug case is prepended with "C:\Python36\lib\site-packages\PySide2"

The problem comes from trying to use PySide2 and PyQt5 at the same time. But why is debug mode trying to use PySide2?

I can't find any Settings | Tools | Python Scientific | Show plots in toolwindow setting for me to adjust.

I certainly would prefer to be able to debug my code.

 

0

Please sign in to leave a comment.