Import dgl: ImportError (about dgl.dll)

Greetings, I’ve ran into some problems about importing dgl, which was unable to load the particular dgl.dll while it do exists in the catrgory. Are there any available suggestions on solving this?

Python: 3.8.1
Cuda: None
Installation: pip install dgl -f https://data.dgl.ai/wheels/repo.html (according to mainpage)
torch: 2.0.1
tensorflow: 2.13.0

Traceback:
import dgl
Traceback (most recent call last):
File “”, line 1, in
File “D:\PyCharm Community Edition 2019.1.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import
module = self.system_import(name, *args, **kwargs)
File "D:\Python\Python38\lib\site-packages\dgl_init
.py", line 14, in
from .backend import backend_name, load_backend # usort: skip
File “D:\PyCharm Community Edition 2019.1.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import
module = self.system_import(name, *args, **kwargs)
File "D:\Python\Python38\lib\site-packages\dgl\backend_init
.py", line 122, in
load_backend(get_preferred_backend())
File “D:\Python\Python38\lib\site-packages\dgl\backend_init_.py”, line 51, in load_backend
from …_ffi.base import load_tensor_adapter # imports DGL C library
File “D:\PyCharm Community Edition 2019.1.3\helpers\pydev_pydev_bundle\pydev_import_hook.py”, line 21, in do_import
module = self._system_import(name, *args, **kwargs)
File “D:\Python\Python38\lib\site-packages\dgl_ffi\base.py”, line 50, in
_LIB, _LIB_NAME, _DIR_NAME = _load_lib()
File “D:\Python\Python38\lib\site-packages\dgl_ffi\base.py”, line 39, in load_lib
lib = ctypes.CDLL(lib_path[0])
File "D:\Python\Python38\lib\ctypes_init
.py", line 373, in init
self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module ‘D:\Python\Python38\lib\site-packages\dgl\dgl.dll’. Try using the full path with constructor syntax.

ps: I’ve searched around stackoverflow or something and it was said that some dependencies of this .dll may be missing, and it seems that two dependencies of dgl.dll was missing(namely cublas64_11.dll and cusparse64_11.dll), but both of which seems to be for those who have installed CUDA and may have been aborted in the newest version of tensorflow. Any possible ways for AMD users to run dgl smoothly?

Hi @ArthasMinehill, I can’t reproduce your errors in my computer, could you try to uninstall the dgl and then reinstall? Or please provide more details for debugging.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.