Hello DGL Community,
I’ve been struggling with an issue for over a week now, and I’m hoping someone here can help. I’m building a Docker image using Python 3.12 as the base, and I’m using PyTorch 2.2 along with the corresponding version of DGL. However, I keep encountering the following error when trying to import DGL:
Traceback (most recent call last):
File "/var/task/evaluate_model.py", line 10, in <module>
import dgl
File "/var/task/dgl/__init__.py", line 16, in <module>
from . import (
File "/var/task/dgl/dataloading/__init__.py", line 13, in <module>
from .dataloader import *
File "/var/task/dgl/dataloading/dataloader.py", line 27, in <module>
from ..distributed import DistGraph
File "/var/task/dgl/distributed/__init__.py", line 5, in <module>
from .dist_graph import DistGraph, DistGraphServer, edge_split, node_split
File "/var/task/dgl/distributed/dist_graph.py", line 11, in <module>
from .. import backend as F, graphbolt as gb, heterograph_index
File "/var/task/dgl/graphbolt/__init__.py", line 8, in <module>
from .base import *
File "/var/task/dgl/graphbolt/base.py", line 8, in <module>
from torchdata.datapipes.iter import IterDataPipe
File "/var/task/torchdata/datapipes/__init__.py", line 11, in <module>
from . import iter, map, utils
File "/var/task/torchdata/datapipes/iter/__init__.py", line 79, in <module>
from torchdata.datapipes.iter.util.cacheholder import (
File "/var/task/torchdata/datapipes/iter/util/cacheholder.py", line 24, in <module>
from torch.utils._import_utils import dill_available
ModuleNotFoundError: No module named 'torch.utils._import_utils'
Here’s my requirements.txt
file:
torch==2.2
dgl -f https://data.dgl.ai/wheels/torch-2.2/repo.html
pydantic
boto3==1.29.6
packaging==23.2
optuna==3.4.0
pandas==2.1.3
scikit-learn==1.3.2
SQLAlchemy==2.0.23
psycopg2-binary
The main issue is that I can’t upgrade PyTorch or DGL because DGL has a hard requirement for the GraphBolt library, which doesn’t seem to be available in versions compatible with anything beyond PyTorch 2.2.
I’ve tried numerous combinations of Python images, PyTorch versions, and DGL configurations, but I keep encountering this issue or similar dependency conflicts. It’s incredibly frustrating to spend so much time trying to get DGL to work in a Docker environment because of these dependency issues.
I would really appreciate any advice or solutions that anyone might have. Has anyone else encountered this, or does anyone know a workaround?
Thank you for your help.