Colab Session Restarts When Importing DeepChem

Hi, I’m trying to install and import the latest version of DeepChem to use it alongside my PyTorch Geometric (PyG) code. (I am not using DGL.) The installation of DeepChem completed successfully, but when I try to import it, the Colab session crashes and restarts.
Is this issue related to dependency conflicts, or could it be a problem with the latest version of DeepChem? How can I resolve this?

Environment Details:
Python version: 3.10.12
Platform: Google Colab

Code and Output:
Here is the code I used along with the resulting outputs:

Install necessary libraries

!pip install torch transformers
import torch
from torch import Tensor
print(torch.version)

Install required packages.

import os
os.environ[‘TORCH’] = torch.version

!pip install torch-scatter -f https://data.pyg.org/whl/torch-{TORCH}.html !pip install torch-sparse -f https://data.pyg.org/whl/torch-{TORCH}.html
!pip install pyg-lib -f https://data.pyg.org/whl/nightly/torch-${TORCH}.html
!pip install git+https://github.com/pyg-team/pytorch_geometric.git
!pip install rdkit-pypi tqdm
!pip install mygene
!pip install scikit-multilearn
!pip install iterative-stratification
!pip install bayesian-optimization
!pip install optuna
!pip install tensorboard
!pip install deepchem
Issue

Hi, @FatmaAbdel I tried to replicate the error you are facing. I am not getting any error while importing DeepChem. Here are some of the minor changes I made to the above code -

import os
os.environ['TORCH'] = torch.__version__

!pip install torch-scatter -f 
https://data.pyg.org/whl/torch-${TORCH}.html

!pip install torch-sparse -f 
https://data.pyg.org/whl/torch-${TORCH}.html

Hi, @riya-singh28. Thank you for your reply. It works when using CUDA (A100 GPU), but it doesn’t work when using the CPU (v2-8 TPU), which I need for its large memory capacity (over 330GB). I think the issue might be related to dependency conflicts, or perhaps the latest version of DeepChem is only compatible with GPUs.