GoldenYoyo
GoldenYoyo

Reputation: 55

pyopenms: DLL load failed: The specified procedure could not be found

I can import pyopenms and the code runs well in spyder. But when I run the same script in Anaconda Prompt, it gives:

Traceback (most recent call last):

File "C:\Users\xx\Desktop\Scripts\Python\GUI\test\LipidAnaGUI - Copy.py", line 23, in module import pyopenms

File "C:\ProgramData\Anaconda3\lib\site-packages\pyopenms_init_.py", line 75, in module raise e

File "C:\ProgramData\Anaconda3\lib\site-packages\pyopenms_init_.py", line 45, in module

from .all_modules import *

File "C:\ProgramData\Anaconda3\lib\site-packages\pyopenms\all_modules.py", line 1, in module

from .pyopenms_1 import *

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

Then I checked the all_modules.py file:

from .pyopenms_1 import *
from .pyopenms_2 import *
from .pyopenms_3 import *
from .pyopenms_4 import *
from .pyopenms_5 import *
from .pyopenms_6 import *
from .pyopenms_7 import *
from .pyopenms_8 import *

Under the same folder, there are pyopenms_1.cpp and pyopenms_1.cp37-win_amd64.pyd files, but not pyopenms_1.py. What should I do?

Upvotes: 2

Views: 1092

Answers (2)

c z
c z

Reputation: 9045

For IDE users only:

PyOpenMs loads Qt even when no GUI is being used. And if another Qt is loaded before PyOpenMs, then this causes it to fail.

GoldenYoyo's comment above, suggests moving your own imports that load Qt (such as matplotlib) to before PyOpenMs. However, IDEs may pre-load the Qt libraries to allow advanced debugging. This feature needs to be disabled in order to load PyOpenMs in an IDE.

In PyCharm/IntelliJ this is:

  • File | Settings | Build execution and deployment | Python debugger | PyQtCompatible = Unchecked

Settings

Upvotes: 1

Yingwei HU
Yingwei HU

Reputation: 48

I had the same problem and solved by copying all Qt5***.dll files from

Anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\bin

to this folder:

Anaconda3\Lib\site-packages\pyopenms

Upvotes: 2

Related Questions