How to install torch-scatter?

krishna511: <p>using below link to install torch-scatter for torch version : ‘2.2.0.dev20230928+cu121’</p>
<pre><code class="lang-auto">pip3 install --pre torch torchvision torchaudio --index-url https://download.pytorch.org/whl/nightly/cu121 

</code></pre>
<p>After installing torch_scatter, and importing torch_scatter, I am getting this error:</p>
<pre><code class="lang-auto">
OSError: /home/.../anaconda3/envs/..../lib/python3.11/site-packages/torch_scatter/_scatter_cpu.so: undefined symbol: _ZN5torch8autograd13_wrap_outputsERKSt6vectorIN2at6TensorESaIS3_EERKSt13unordered_setIPN3c1010TensorImplESt4hashISB_ESt8equal_toISB_ESaISB_EESJ_NS9_8ArrayRefINS9_8optionalIS3_EEEERKSt10shared_ptrINS0_4NodeEESt8functionIFS5_S5_S5_EESJ_
</code></pre>
<p>It was working fine previously. My cuda is 12.<br>
Please guide <a class="mention" href="/u/ptrblck">@ptrblck</a>. This is for others also.</p>

ptrblck: <p>I guess your <code>torch-scatter</code> installation might not be compatible with the latest PyTorch nightly, so either install a nightly scatter binary (if available) or build it from source.</p>

krishna511: <p>Sir could you please elaborate I am not sure how to proceed. Why this was working sometime before on same day, and now its not working.</p>

krishna511: <p>Sir, I tried the link :<br>
<code>pip install torch-scatter==2.0.8 -f https://data.pyg.org/whl/torch-1.8.1+cu102.html</code></p>
<p>from<br>
<code>https://pytorch-geometric.com/whl/torch-1.8.1+cu102.html</code></p>
<p>Then the error is:</p>
<pre><code class="lang-auto">Traceback (most recent call last):

  Cell In[3], line 1
    import torch_scatter

  File ~/anaconda3/envs/Krishna/lib/python3.11/site-packages/torch_scatter/__init__.py:17
    raise AttributeError(e)

AttributeError: 'NoneType' object has no attribute 'origin'
</code></pre>
<pre><code class="lang-auto">In short, I want to install the correct version of torch_scatter for my torch version: '2.2.0.dev20230928+cu121'</code></pre>

ptrblck: <p>You have installed a nightly PyTorch binary and would thus need to install a pytorch-scatter version which is compatible with such a new build. I don’t know if nightly binaries are available but if not you would need to build pytorch-scatter from source.</p>

krishna511: <p>Sir <a class="mention" href="/u/ptrblck">@ptrblck</a> please tell me which pytorch stable version should I download for my machine, with cuda 12, and compatible torch_scatter. Like If I download pytorch for cuda 11 will it work?<br>
Regards</p>

krishna511: <p><span class="mention">@sir</span> I tried using CPU also, please guide what to do? If I can know which version of torch-scatter is compatible for CPU.</p>

krishna511: <p><a class="mention" href="/u/ptrblck">@ptrblck</a> Sir I have cuda 12.0 which does not support torch stable version. So for the sake of programming I installed torch without cuda i.e. with CPU from <a href="https://pytorch.org/" rel="noopener nofollow ugc">here</a>. But after successful installation of torch and torch geometric and torch scatter, I am still getting this error:</p>
<p><strong>OSError: /home/anaconda3/envs/lib/python3.11/site-packages/torch_scatter/_scatter_cpu.so: undefined symbol: _ZN5torch8autograd13_wrap_outputsERKSt6vectorIN2at6TensorESaIS3_EERKSt13unordered_setIPN3c1010TensorImplESt4hashISB_ESt8equal_toISB_ESaISB_EESJ_NS9_8ArrayRefINS9_8optionalIS3_EEEERKSt10shared_ptrINS0_4NodeEERKSt8functionIFS5_S5_S5_EESJ_RKST_IFS3_S3_EE</strong></p>
<p>Please guide what to do?</p>

ptrblck: <aside class="quote no-group" data-username="krishna511" data-post="8" data-topic="189148">
<div class="title">
<div class="quote-controls"></div>
<img loading="lazy" alt="" width="24" height="24" src="https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/krishna511/48/30486_2.png" class="avatar"> krishna511:</div>
<blockquote>
<p>Sir I have cuda 12.0 which does not support torch stable version.</p>
</blockquote>
</aside>
<p>It does and the current stable as well as nightly binaries ship with CUDA 11.8 and 12.1 as seen <a href="https://pytorch.org/get-started/locally/">here</a>.</p>

krishna511: <p>Sir I have tried, 11.8, But the torch scatter throwing some error that it is running without cuda. Are you saying that with Nvidia Cuda 12 I can use 11.8 and 12.1, will it support my cuda.<br>
Also I am using same resource for downling which you pointed.</p>