Torch_geometric.nn package gives versioning error when importing

username: Bixqu
cooked: <p>The import:</p>
<pre><code class="lang-auto">from torch_geometric.nn import GCNConv
</code></pre>
<p>returns:</p>
<pre><code class="lang-auto">---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
~/anaconda3/envs/py38/lib/python3.8/site-packages/torch_cluster/__init__.py in &lt;module&gt;
     13     ]:
---&gt; 14         torch.ops.load_library(importlib.machinery.PathFinder().find_spec(
     15             library, [osp.dirname(__file__)]).origin)

~/anaconda3/envs/py38/lib/python3.8/site-packages/torch/_ops.py in load_library(self, path)
    109             # operators with the JIT.
--&gt; 110             ctypes.CDLL(path)
    111         self.loaded_libraries.add(path)

~/anaconda3/envs/py38/lib/python3.8/ctypes/__init__.py in __init__(self, name, mode, handle, use_errno, use_last_error, winmode)
    372         if handle is None:
--&gt; 373             self._handle = _dlopen(self._name, mode)
    374         else:

OSError: /home/user/anaconda3/envs/py38/lib/python3.8/site-packages/torch_cluster/_version.so: undefined symbol: _ZN3c1017RegisterOperatorsD1Ev

During handling of the above exception, another exception occurred:

RuntimeError                              Traceback (most recent call last)
&lt;ipython-input-5-b6dacbfe5071&gt; in &lt;module&gt;
      2 import torch.nn as nn
      3 from torch.nn import CrossEntropyLoss
----&gt; 4 from torch_geometric.nn import GCNConv #, AGNNConv,  GraphConv, TopKPooling, global_mean_pool, SAGEConv
      5 #from torch_geometric.nn import ChebConv, GATConv,  HypergraphConv,  GINConv, SGConv,  TransformerConv
      6 

~/anaconda3/envs/py38/lib/python3.8/site-packages/torch_geometric/nn/__init__.py in &lt;module&gt;
      3 from .sequential import Sequential
      4 from .data_parallel import DataParallel
----&gt; 5 from .to_hetero_transformer import to_hetero
      6 from .to_hetero_with_bases_transformer import to_hetero_with_bases
      7 from .conv import *  # noqa

~/anaconda3/envs/py38/lib/python3.8/site-packages/torch_geometric/nn/to_hetero_transformer.py in &lt;module&gt;
      7 from torch.nn import Module
      8 
----&gt; 9 from torch_geometric.nn.fx import Transformer
     10 from torch_geometric.typing import EdgeType, Metadata, NodeType
     11 from torch_geometric.utils.hetero import get_unused_node_types

~/anaconda3/envs/py38/lib/python3.8/site-packages/torch_geometric/nn/fx.py in &lt;module&gt;
      5 from torch.nn import Module, ModuleDict, ModuleList, Sequential
      6 
----&gt; 7 from torch_geometric.nn.conv import MessagePassing
      8 
      9 try:

~/anaconda3/envs/py38/lib/python3.8/site-packages/torch_geometric/nn/conv/__init__.py in &lt;module&gt;
      4 from .sage_conv import SAGEConv
      5 from .graph_conv import GraphConv
----&gt; 6 from .gravnet_conv import GravNetConv
      7 from .gated_graph_conv import GatedGraphConv
      8 from .res_gated_graph_conv import ResGatedGraphConv

~/anaconda3/envs/py38/lib/python3.8/site-packages/torch_geometric/nn/conv/gravnet_conv.py in &lt;module&gt;
     10 
     11 try:
---&gt; 12     from torch_cluster import knn
     13 except ImportError:
     14     knn = None

~/anaconda3/envs/py38/lib/python3.8/site-packages/torch_cluster/__init__.py in &lt;module&gt;
     18     t_major, t_minor = expected_torch_version
     19     if major != t_major or (major == t_major and minor != t_minor):
---&gt; 20         raise RuntimeError(
     21             f'Expected PyTorch version {t_major}.{t_minor} but found '
     22             f'version {major}.{minor}.')

RuntimeError: Expected PyTorch version 1.4 but found version 1.10.
</code></pre>
<p>My pytorch version is indeed 1.10:</p>
<pre><code class="lang-auto">print(torch.__version__)
1.10.0+cu102
</code></pre>
<p>Any idea what is happening?</p>

username: ArchieGertsman
cooked: <p>It’s saying your PyTorch version is 1.10 but it requires version 1.4. Maybe you need to update PyTorch-Geometric? Note that it’s a separate library.</p>