The problem of installing torch_geometric in Colab

Jacky1: <p>When i run the code in Colab</p>
<blockquote>
<p>! python ./drive/MyDrive/神经网络训练文件/DAGCN-main/DAGCN/train_advanced.py</p>
</blockquote>
<p>Then happened</p>
<pre><code class="lang-auto">Traceback (most recent call last):
  File "/content/./drive/MyDrive/神经网络训练文件/DAGCN-main/DAGCN/train_advanced.py", line 9, in &lt;module&gt;
    from utils.train_utils_combines import train_utils
  File "/content/drive/MyDrive/神经网络训练文件/DAGCN-main/DAGCN/utils/train_utils_combines.py", line 13, in &lt;module&gt;
    import models
  File "/content/drive/MyDrive/神经网络训练文件/DAGCN-main/DAGCN/models/__init__.py", line 3, in &lt;module&gt;
    from models.DAGCN import DAGCN_features
  File "/content/drive/MyDrive/神经网络训练文件/DAGCN-main/DAGCN/models/DAGCN.py", line 6, in &lt;module&gt;
    from models.MRF_GCN import MRF_GCN
  File "/content/drive/MyDrive/神经网络训练文件/DAGCN-main/DAGCN/models/MRF_GCN.py", line 6, in &lt;module&gt;
    from torch_geometric.nn import  ChebConv, BatchNorm
ModuleNotFoundError: No module named 'torch_geometric'
</code></pre>
<p>So I try to install it</p>
<blockquote>
<p>!pip install torch-scatter torch-sparse torch-cluster torch-spline-conv torch-geometric --no-cache-dir</p>
</blockquote>
<pre><code class="lang-auto">Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting torch-scatter
  Downloading torch_scatter-2.1.0.tar.gz (106 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 106.8/106.8 KB 5.4 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting torch-sparse
  Downloading torch_sparse-0.6.16.tar.gz (208 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 208.2/208.2 KB 21.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting torch-cluster
  Downloading torch_cluster-1.6.0.tar.gz (43 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.4/43.4 KB 151.7 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Collecting torch-spline-conv
  Downloading torch_spline_conv-1.2.1.tar.gz (13 kB)
  Preparing metadata (setup.py) ... done
Collecting torch-geometric
  Downloading torch_geometric-2.2.0.tar.gz (564 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 565.0/565.0 KB 61.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: scipy in /usr/local/lib/python3.9/dist-packages (from torch-sparse) (1.10.1)
Requirement already satisfied: tqdm in /usr/local/lib/python3.9/dist-packages (from torch-geometric) (4.65.0)
Requirement already satisfied: numpy in /usr/local/lib/python3.9/dist-packages (from torch-geometric) (1.22.4)
Requirement already satisfied: jinja2 in /usr/local/lib/python3.9/dist-packages (from torch-geometric) (3.1.2)
Requirement already satisfied: requests in /usr/local/lib/python3.9/dist-packages (from torch-geometric) (2.25.1)
Requirement already satisfied: pyparsing in /usr/local/lib/python3.9/dist-packages (from torch-geometric) (3.0.9)
Requirement already satisfied: scikit-learn in /usr/local/lib/python3.9/dist-packages (from torch-geometric) (1.2.1)
Collecting psutil&gt;=5.8.0
  Downloading psutil-5.9.4-cp36-abi3-manylinux_2_12_x86_64.manylinux2010_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (280 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 280.2/280.2 KB 224.5 MB/s eta 0:00:00
Requirement already satisfied: MarkupSafe&gt;=2.0 in /usr/local/lib/python3.9/dist-packages (from jinja2-&gt;torch-geometric) (2.1.2)
Requirement already satisfied: urllib3&lt;1.27,&gt;=1.21.1 in /usr/local/lib/python3.9/dist-packages (from requests-&gt;torch-geometric) (1.26.14)
Requirement already satisfied: certifi&gt;=2017.4.17 in /usr/local/lib/python3.9/dist-packages (from requests-&gt;torch-geometric) (2022.12.7)
Requirement already satisfied: idna&lt;3,&gt;=2.5 in /usr/local/lib/python3.9/dist-packages (from requests-&gt;torch-geometric) (2.10)
Requirement already satisfied: chardet&lt;5,&gt;=3.0.2 in /usr/local/lib/python3.9/dist-packages (from requests-&gt;torch-geometric) (4.0.0)
Requirement already satisfied: threadpoolctl&gt;=2.0.0 in /usr/local/lib/python3.9/dist-packages (from scikit-learn-&gt;torch-geometric) (3.1.0)
Requirement already satisfied: joblib&gt;=1.1.1 in /usr/local/lib/python3.9/dist-packages (from scikit-learn-&gt;torch-geometric) (1.2.0)
Building wheels for collected packages: torch-scatter, torch-sparse, torch-cluster, torch-spline-conv, torch-geometric......
</code></pre>
<p>But it’s always runing rather than stopping, I don’t know why and what should I do. If U can help I will appreciate for U!!! <img src="https://discuss.pytorch.org/images/emoji/apple/heart_eyes.png?v=12" title=":heart_eyes:" class="emoji" alt=":heart_eyes:" loading="lazy" width="20" height="20"></p>

ptrblck: <p>Based on the output I guess your Python environment tries to build the missing packages from source, which might need some time and resources. I don’t know if you might be running out of memory, but would assume Colab should warn you if that’s the case.<br>
How long did you wait for the build process to finish?</p>