FileNotFoundError for libdgl.dll in DGL Package Installation

79 views Asked by At

I'm encountering a FileNotFoundError when trying to import the Deep Graph Library (DGL) package in Python. The error message specifically mentions the inability to find the module 'D:\Anaconda\envs\cola\lib\site-packages\dgl\libdgl.dll'. It seems like there's an issue with locating this DLL file or its dependencies. Here's the full error message:

PS C:\Users\phant\OneDrive\Desktop\cola> python run.py --dataset cora
Traceback (most recent call last):
  File "C:\Users\phant\OneDrive\Desktop\cola\run.py", line 7, in <module>
    from utils import *
  File "C:\Users\phant\OneDrive\Desktop\cola\utils.py", line 7, in <module>
    import dgl
  File "D:\Anaconda\envs\cola\lib\site-packages\dgl\__init__.py", line 4, in <module>
    from . import nn
  File "D:\Anaconda\envs\cola\lib\site-packages\dgl\nn\__init__.py", line 11, in <module>       
    from .pytorch import *
  File "D:\Anaconda\envs\cola\lib\site-packages\dgl\nn\pytorch\__init__.py", line 1, in <module>
    from .gcn import GraphConvolutionLayer
  File "D:\Anaconda\envs\cola\lib\site-packages\dgl\nn\pytorch\gcn.py", line 11, in <module>    
    from ...base import ALL, is_all
  File "D:\Anaconda\envs\cola\lib\site-packages\dgl\base.py", line 6, in <module>
    from ._ffi.base import DGLError
  File "D:\Anaconda\envs\cola\lib\site-packages\dgl\_ffi\base.py", line 43, in <module>
    _LIB, _LIB_NAME = _load_lib()
  File "D:\Anaconda\envs\cola\lib\site-packages\dgl\_ffi\base.py", line 35, in _load_lib
    lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
  File "D:\Anaconda\envs\cola\lib\ctypes\__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
FileNotFoundError: Could not find module 'D:\Anaconda\envs\cola\lib\site-packages\dgl\libdgl.dll' (or one of its dependencies). Try using the full path with constructor syntax.

I've installed DGL using Anaconda, and I'm working within a virtual environment named 'cola'. Despite successfully installing the package, importing it raises this error. Could someone provide guidance on how to resolve this issue? What could be causing this error, and how can I ensure that the necessary DLL and its dependencies are correctly installed and accessible within my Python environment? Any help would be greatly appreciated. Thank you!

0

There are 0 answers