Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to load dynlib/dll 'D:\\Users\\16886\\Desktop\\molpy\\caffe2_detectron_ops.dll'. #4935

Closed
caiyingchun opened this issue Jun 15, 2020 · 4 comments · Fixed by #5168
Closed

Comments

@caiyingchun
Copy link

The code successfully works while executing using CMD , but when it is binded to *.exe file using Pyinstaller, It throws an error and stops executing (the Message is given below). I tried all possible solutions by linking the path library and other stuff too. Any tries failed, although the file caffe2_detectron_ops.dll was included in the right folder.
OS system: win10
Python 3.7
Pyinstaller3.6
Pytorch1.5.0
PyQt5

Traceback (most recent call last):
  File "site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 151, in __init__
  File "ctypes\__init__.py", line 364, in __init__
OSError: [WinError 126] 找不到指定的模块。

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "MolPy\molpy.py", line 21, in <module>
    from dgljtnn.molecule_generation import generate
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "D:\Program\PyMOL-2.3.4_121-Win64-portable-py37\PyMOL\envs\molpy\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
    exec(bytecode, module.__dict__)
  File "MolPy\dgljtnn\molecule_generation.py", line 4, in <module>
    import torch
  File "<frozen importlib._bootstrap>", line 983, in _find_and_load
  File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "D:\Program\PyMOL-2.3.4_121-Win64-portable-py37\PyMOL\envs\molpy\lib\site-packages\PyInstaller\loader\pyimod03_importers.py", line 623, in exec_module
    exec(bytecode, module.__dict__)
  File "site-packages\torch\__init__.py", line 81, in <module>
  File "site-packages\PyInstaller\loader\pyiboot01_bootstrap.py", line 153, in __init__
__main__.PyInstallerImportError: Failed to load dynlib/dll 'D:\\Users\\16886\\Desktop\\molpy\\caffe2_detectron_ops.dll'. Most probably this dynlib/dll was not found when the application was frozen.
[20848] Failed to execute script molpy

Who can help me? Thanks very much.

@JStuckner
Copy link

Did you ever solve this problem? I have the same problem?

@caiyingchun
Copy link
Author

@JStuckner Yes, I solved the problem. inter-openmp is needed by pytorch.
You can check pytorch/pytorch#35803
pip install intel-openmp
After installing this library, copy libiomp5md.dll, libiomp5md.pdb, and libiompstubs5md.dll from ../Library/bin to your *.exe folder. It will work.

bwoodsend added a commit to bwoodsend/pyinstaller that referenced this issue Sep 14, 2020
Whilst I'm here also:

- Exclude numpy's testing and C/Fortran compiling code, and
  everything else it drags with it (namely scipy).
- Try to fix Conda support.
- Avoid dragging 400MB of unused MKL DLLs on Conda.

They're all closed due to our no-conda policy but, (for now) fixes
 pyinstaller#4935, pyinstaller#4968, pyinstaller#5075, pyinstaller#5082, pyinstaller#5019 and pyinstaller#5019. Although likely at
the expense of junk DLLs being dragged in.
bwoodsend added a commit to bwoodsend/pyinstaller that referenced this issue Sep 17, 2020
Whilst I'm here also:

- Exclude numpy's testing and C/Fortran compiling code, and
  everything else it drags with it (namely scipy).
- Try to fix Conda support.
- Avoid dragging 400MB of unused MKL DLLs on Conda.

They're all closed due to our no-conda policy but, (for now) fixes
 pyinstaller#4935, pyinstaller#4968, pyinstaller#5075, pyinstaller#5082, pyinstaller#5019 and pyinstaller#5019. Although likely at
the expense of junk DLLs being dragged in.
@maisonhai3
Copy link

I solved this problem by:

  1. Conda uninstall torch, torchvision and relatings. I used conda to install torch as guided by pytorch.com
  2. Using pip to install torch, torchvision.

@KiteFlyKid
Copy link

I solved this problem by:

  1. Conda uninstall torch, torchvision and relatings. I used conda to install torch as guided by pytorch.com
  2. Using pip to install torch, torchvision.

It works. The solution provided by Anaconda doesn't work at all. Just refuse conda.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants