dmlc / dmlc/dgl

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

Open
#7,873 3 comments 0 reactions 0 assignees View on GitHub
stale-issue
Dominant language
Python
Stars
14.3k
Forks
3.1k
PR merge metrics
No merged PRs in 30d

Description

## 🐛 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

```python
(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 "", line 1, in
File "D:\Anaconda3\envs\pytorch\Lib\site-packages\dgl-2.5-py3.12-win-amd64.egg\dgl\sparse\__init__.py", line 43, in
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](https://github.com/user-attachments/assets/be5f0cc8-e628-44e7-8d6a-489a0a0aad82)

![Image](https://github.com/user-attachments/assets/1d186ac9-d9cd-4cf1-83fc-df3414771b37)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.