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

[Windows] Native pip Windows installation depends on MinGW libraries #293

Closed
hurun opened this issue Dec 11, 2018 · 17 comments
Closed

[Windows] Native pip Windows installation depends on MinGW libraries #293

hurun opened this issue Dec 11, 2018 · 17 comments
Assignees

Comments

@hurun
Copy link

hurun commented Dec 11, 2018

🐛 Bug

To Reproduce

Steps to reproduce the behavior:

1.import dgl
1.
1.

Expected behavior

Environment

  • DGL Version (e.g., 1.0): dgl-0.1.2
  • Backend Library & Version (e.g., PyTorch 0.4.1, MXNet/Gluon 1.3): 1.0.0
  • OS (e.g., Linux): windows 10
  • How you installed DGL (conda, pip, source): pip
  • Build command you used (if compiling from source):
  • Python version: 3.6.1
  • CUDA/cuDNN version (if applicable): 9.0
  • GPU models and configuration (e.g. V100): i dont know how to find this
  • Any other relevant information:

Additional context

Traceback (most recent call last):
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\site-packages\IPython\core\interactiveshell.py", line 2963, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
import dgl
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self.system_import(name, *args, **kwargs)
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\site-packages\dgl_init
.py", line 4, in
from . import nn
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self.system_import(name, *args, **kwargs)
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\site-packages\dgl\nn_init
.py", line 11, in
from .pytorch import *
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self.system_import(name, *args, **kwargs)
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\site-packages\dgl\nn\pytorch_init
.py", line 1, in
from .gcn import GraphConvolutionLayer
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\site-packages\dgl\nn\pytorch\gcn.py", line 11, in
from ...base import ALL, is_all
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\site-packages\dgl\base.py", line 6, in
from ._ffi.base import DGLError
File "C:\Program Files\JetBrains\PyCharm Community Edition 2017.3.3\helpers\pydev_pydev_bundle\pydev_import_hook.py", line 20, in do_import
module = self._system_import(name, *args, **kwargs)
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\site-packages\dgl_ffi\base.py", line 43, in
_LIB, _LIB_NAME = _load_lib()
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\site-packages\dgl_ffi\base.py", line 35, in load_lib
lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
File "C:\Users\胡润\AppData\Local\Programs\Python\Python36\lib\ctypes_init
.py", line 348, in init
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] 找不到指定的模块。

@mufeili
Copy link
Member

mufeili commented Dec 11, 2018

Thank you for contacting us. To better identify and reproduce the issue here, could you please fill in the environment related info?

@hurun
Copy link
Author

hurun commented Dec 11, 2018

Thank you for contacting us. To better identify and reproduce the issue here, could you please fill in the environment related info?

yes, i will do.

@mufeili mufeili changed the title when import dgl ,and the error happened, OSError: [WinError 126] 找不到指定的模块。 [Windows Path] when import dgl ,and the error happened, OSError: [WinError 126] 找不到指定的模块。 Dec 11, 2018
@hurun hurun changed the title [Windows Path] when import dgl ,and the error happened, OSError: [WinError 126] 找不到指定的模块。 [Windows Path] when import dgl ,and the error happened, OSError: [WinError 126] 找不到指定的模块 Dec 11, 2018
@mufeili
Copy link
Member

mufeili commented Dec 11, 2018

Personally I'm not a Windows user so see if other team members have more experience and suggestions. Meanwhile, this seems to be a common issue for Windows users. You can find discussions about similar issues on Stack Overflow like this thread. See if some solutions suggested there can address your problem.

@BarclayII BarclayII changed the title [Windows Path] when import dgl ,and the error happened, OSError: [WinError 126] 找不到指定的模块 [Windows] Importing dgl raises error "No specified module could be found" Dec 11, 2018
@BarclayII
Copy link
Collaborator

It seems that currently Windows installation depends on MinGW, i.e. with LibGCC/PThread/etc. Native Windows installation with pip doesn't work right now.

Could you please try using anaconda instead?

@BarclayII BarclayII changed the title [Windows] Importing dgl raises error "No specified module could be found" [Windows] Native pip Windows installation depends on MinGW libraries Dec 11, 2018
@hurun
Copy link
Author

hurun commented Dec 12, 2018

It seems that currently Windows installation depends on MinGW, i.e. with LibGCC/PThread/etc. Native Windows installation with pip doesn't work right now.

Could you please try using anaconda instead?

I use anoconda to fix this problem. it works now.

@hurun
Copy link
Author

hurun commented Dec 12, 2018

Personally I'm not a Windows user so see if other team members have more experience and suggestions. Meanwhile, this seems to be a common issue for Windows users. You can find discussions about similar issues on Stack Overflow like this thread. See if some solutions suggested there can address your problem.

I use anoconda to fix this problem. it works now.

@BarclayII
Copy link
Collaborator

Reopening this issue since (real) native windows build is being worked on.

@BarclayII BarclayII reopened this Dec 17, 2018
@BarclayII BarclayII self-assigned this Dec 17, 2018
@CXX1113
Copy link

CXX1113 commented Dec 18, 2018

Personally I'm not a Windows user so see if other team members have more experience and suggestions. Meanwhile, this seems to be a common issue for Windows users. You can find discussions about similar issues on Stack Overflow like this thread. See if some solutions suggested there can address your problem.

I use anoconda to fix this problem. it works now.

Why do I use Anaconda, but I still report an error? How did you solve it?

Edit New issue
ImportError: DLL load failed: The specified module could not be found.

@BarclayII
Copy link
Collaborator

Using anaconda should have you install MinGW dependencies. Could you make sure you are starting Python within Anaconda (by checking whether the Python banner contains the string Anaconda)?

@BarclayII
Copy link
Collaborator

Native Windows wheels will be available in the next patch release (0.1.4)

@saltball
Copy link

It seems to happen when I used anaconda without installing vsXXXX_runtime or vsXXXX_win-64. And when they were installed, no more [OSError] happened.

@Zayme249Shaw
Copy link

Zayme249Shaw commented Jan 15, 2019

I notice that the code in libinfo.py of the packages' code has mentioned 2 dll files but i only find libdgl.dll in the package file.Is the dgl.dll lost?And how could i get this file?

        if sys.platform.startswith('win32'):
            lib_dll_path = [os.path.join(p, 'libdgl.dll') for p in dll_path] +\
                           [os.path.join(p, 'dgl.dll') for p in dll_path]

@BarclayII
Copy link
Collaborator

@Zayme249Shaw You only need one of these files. libdgl.dll is the output from MinGW compilers and dgl.dll is the one from MSBuild. We will switch to the MSBuild one in the next release.

@BarclayII
Copy link
Collaborator

DGL 0.2 for Windows is released on Conda and Pip. Please feel free to reopen this issue if it doesn't work.

@foolish318
Copy link

I met the same error in Windows system and using conda to install the package. Is there any suggestion to fix it ? Thanks a lot

@BarclayII
Copy link
Collaborator

BarclayII commented Nov 24, 2019

I met the same error in Windows system and using conda to install the package. Is there any suggestion to fix it ? Thanks a lot

Since current DGL no longer depends on MinGW, I would imagine that either Visual C++ 2015 runtime, the Universal C runtime, or CUDA (if you're installing a GPU version) is missing.

Were you able to locate the dgl.dll in the DGL package and open it with the new Dependency Walker? That should tell you which dependency library is missing.

@foolish318
Copy link

I followed your method and found that there are two dll file not found. I think install the latest CUDA toolkit should fix the problem. Thanks a lot for you help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants