Open DanielYang59 opened 1 month ago
Same error, have tried all combination of versions. Would appreciate a head up if someone managed to solve this :)
Anyone got this working yet?
We still have this problem in new versions, has anyone fixed this problem?
As a workaround, I was able to make import dgl
successfully by installing older versions of PyTorch and torchdata:
$ pip install torch==2.2.1
$ pip install torchdata==0.7.1
In dgl website,it says:
may be this can give you some ideas.
And i also met this problem,but i need to install 2.2.1version of dgl in windows 10.it seems like i should install it from source code?If anybody knows that ,please tell me how i could solve this ,thank you so much.
I have managed to make mine working, under the DGL package site there are several "libgraphbolt_pytorch_2.x.x.dylib" files you could find and you will know which versions of pytorch you should use. Mine issue arose from having a corrupted pytorch version registered and DGL could not properly recognize the pytorch 2.2.1 that I have installed, manually removing the corrupted pytorch files from site-packages has fixed the problem for me
Since 2024.06.27, we have stopped providing packages for Windows and MacOS. The latest version of available package is 2.2.1. For newer versions, please install from source.
Thanks for sharing the info.
Also I appreciate everyone's comment, however downgrading to torch==2.2.1
is not the solution to the problem.
It turns out dgl does ship pre-built binary here, but only for certain versions of torch
and python
, for other versions we might need to build from source.
I could confirm building from source following the guidance works for my Ubuntu 22.04 machine.
For a CPU-only build with torch==2.4.1, python==3.12:
git clone --recurse-submodules https://github.com/dmlc/dgl.git && cd dgl
bash script/create_dev_conda_env.sh -c -t 2.4.1 -p 3.12 # or other versions of your choice
bash script/build_dgl.sh -c
cd python && pip install .
$ pip freeze | grep torch
torch==2.4.1+cpu
torch-geometric==2.6.1
torcheval==0.0.7
torchmetrics==1.5.1
$ pip freeze | grep dgl
dgl @ file:///home/yang/dgl/python
$ python -c "import dgl" # no error this time
Worth noting is it takes quite some time to download & install the conda env (> 10 min) and a lot of RAM to build (~ 30 GB), make sure you have enough RAM otherwise you might see OOM errors.
🐛 Bug
I believe this is a duplicate of #7247 (but for
torch
2.4.1).To Reproduce
Steps to reproduce the behavior:
Environment
conda
,pip
, source): pipAdditional context