Cannot `pip install torch` (MacOS / Python 3.11)

p-i: <pre><code class="lang-bash">🧢 pi@pis-MacBook-Pro ~
&gt; cd ~/Desktop/

🧢 pi@pis-MacBook-Pro ~/Desktop
&gt; python -m venv  --upgrade-deps  .venv

🧢 pi@pis-MacBook-Pro ~/Desktop
&gt; . .venv/bin/activate

(.venv)
🧢 pi@pis-MacBook-Pro ~/Desktop
&gt; python --version
Python 3.11.1

(.venv)
🧢 pi@pis-MacBook-Pro ~/Desktop
&gt; pip install torch
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
</code></pre>
<p>This is rather feeble. Python 3.11 was out 3+ months ago. And PyTorch is pretty much Industry Leader at time of writing AFAICS.</p>
<p>What’s blocking this?</p>
<p>Related:</p>
<ul>
<li><a href="https://discuss.pytorch.org/t/cant-install-pytorch-on-macos/168501" class="inline-onebox">Can't Install PyTorch on MacOS</a></li>
<li><a href="https://github.com/pytorch/pytorch/issues/86566" class="inline-onebox" rel="noopener nofollow ugc">Support Python 3.11 · Issue #86566 · pytorch/pytorch · GitHub</a></li>
</ul>

ptrblck: <p>The linked GitHub issue describes the open tasks, which you could track there.<br>
Assuming some of them are still open I’m sure contributions are more than welcome.</p>

p-i: <p>fwiw I’m not trying to be a dick here.</p>
<p>ML first-timers will probably realize thru bouncing YouTube/Google/Discord that most of the action is happening around pytorch. And a lot of them will bump into the above fail and end up searching this forum.</p>
<p>So it would make sense to have a summary somewhere google-visible. That GitHub issue is a massive wall of text.</p>
<p>In short, you can use your SYSTEM python to create your .venv:</p>
<pre><code class="lang-bash">&gt; /usr/bin/python3 -m venv .venv
</code></pre>
<p>My mac shows:</p>
<pre><code class="lang-bash">&gt; /usr/bin/python3 --version
Python 3.9.6
</code></pre>
<p>… and I’m running latest macOS (13.1 Ventura).</p>
<p>If you <code>. .venv/bin/activate</code> you should be able to <code>pip install torch</code> with no problems.</p>

ptrblck: <p>I understand your question and frustration and don’t know what answer you expect to “What is blocking this?” besides the already tracked progress in the issue you’ve already found.<br>
PyTorch is an open source project and community contributions are more than welcome.<br>
Likewise suggestions how to improve the landing page etc.</p>
<p>I cannot comment on the Mac install issues in 3.11 and/or 3.9 as it’s not my area of expertise.</p>

p-i: <p>I’ll close out the ticket by marking my previous post as solution, so anyone that ends up here has a quick-fix.</p>
<p>I kinda wish GitHub Issue tracker had a feature whereby maintainers could accrete a TLDR at the top of each topic (I often end up rabbitholing down github issue threads).</p>

Ozono: <p>seems to be working for me thank you!</p>

mkr-rzs: <p>Hi, my device is m1 sonoma and using pyenv, i try both python 3.9 and 3.10 but got</p>
<pre><code class="lang-auto">ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
</code></pre>
<p>I try <code>torch-2.2.0.dev20231010-cp39-none-macosx_11_0_arm64.whl</code><br>
but I got<br>
<code>is not a supported wheel</code><br>
Do you guys know any source to solve this problem?<br>
Thank you</p>
<p>[Update]<br>
I use miniconda and its working. Anyone know why in miniconda works but pyenv give error?</p>