ImportError: Cannot load Graphbolt C++ library with colab

Since my local gpu memory is not enough, I use colab to run my experiment. However, when importing dgl, ImportError: Cannot load Graphbolt C++ library occurs. The configuration is torch2.3.0+cu121, and dgl-2.2.1+cu121 is successfully installed using pip install dgl -f https://data.dgl.ai/wheels/torch-2.3/cu121/repo.html. Uninstalling dgl and reinstalling it does not work. Is there any solution?

1 Like

Could you provide the full error log?

I tried Google Colab with

# Install required packages.
import os
import torch
import numpy as np
os.environ['TORCH'] = torch.__version__
os.environ['DGLBACKEND'] = "pytorch"

# Install the CPU version in default. If you want to install CUDA version,
# please refer to https://www.dgl.ai/pages/start.html and change runtime type
# accordingly.
device = torch.device("cpu")
!pip install  dgl -f https://data.dgl.ai/wheels/torch-2.3/cu121/repo.html

try:
    import dgl
    import dgl.graphbolt as gb
    installed = True
except ImportError as error:
    installed = False
    print(error)
print("DGL installed!" if installed else "DGL not found!")

Seems works well, can you check?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.