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

FileNotFoundError: Cannot find DGL C++ sparse library (but for dgl v2.5, pytorch v2.4.0) #7873

Open
trilliverse opened this issue Mar 2, 2025 · 0 comments

Comments

@trilliverse
Copy link

🐛 Bug

To Reproduce

Steps to reproduce the behavior:

  1. install from source according to https://www.dgl.ai/dgl_docs/install/index.html#windows
  2. import dgl.sparse
  3. FileNotFoundError: Cannot find DGL C++ sparse library at D:\Anaconda3\envs\pytorch\Lib\site-packages\dgl-2.5-py3.12-win-amd64.egg\dgl\dgl_sparse\dgl_sparse_pytorch_2.4.0.dll
(pytorch) C:\Users\Acref>python
Python 3.12.0 | packaged by Anaconda, Inc. | (main, Oct  2 2023, 17:20:38) [MSC v.1916 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import dgl.sparse
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "D:\Anaconda3\envs\pytorch\Lib\site-packages\dgl-2.5-py3.12-win-amd64.egg\dgl\sparse\__init__.py", line 43, in <module>
    load_dgl_sparse()
  File "D:\Anaconda3\envs\pytorch\Lib\site-packages\dgl-2.5-py3.12-win-amd64.egg\dgl\sparse\__init__.py", line 35, in load_dgl_sparse
    raise FileNotFoundError(f"Cannot find DGL C++ sparse library at {path}")
FileNotFoundError: Cannot find DGL C++ sparse library at D:\Anaconda3\envs\pytorch\Lib\site-packages\dgl-2.5-py3.12-win-amd64.egg\dgl\dgl_sparse\dgl_sparse_pytorch_2.4.0.dll

but it is ok when import dgl

Expected behavior

Environment

  • DGL Version : 2.5 (I have a question here since the latest version is v2.4, but when I install from source, it turns out that dgl v2.5)
  • Backend Library & Version: Pytorch 2.4.0
  • OS (e.g., Linux): Windows 11
  • How you installed DGL (conda, pip, source): source
  • Build command you used (if compiling from source): run the following in x64 Native Tools Command Prompt for VS 2022:
mkdir build
cd build
cmake -DCMAKE_CXX_FLAGS="/DDGL_EXPORTS" -DCMAKE_CONFIGURATION_TYPES="Release" -DDMLC_FORCE_SHARED_CRT=ON .. -G "Visual Studio 17 2022"
msbuild dgl.sln /m
cd ..\python
python setup.py install
  • Python version: 3.12.0
  • CUDA/cuDNN version (if applicable): no cuda
  • GPU models and configuration (e.g. V100): no gpu
  • Any other relevant information:

Additional context

the virtual environment is named as "pytorch" in anaconda;

Image

Image

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

1 participant