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 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 and change runtime type
# accordingly.
device = torch.device("cpu")
!pip install  dgl -f

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

Seems works well, can you check?