Pytorch supports Python 3.10.
Python 3.11 isn't fully supported yet.
Answer from e-motta on Stack OverflowIs there somewhere a searchable version compatibility database? As in all python projects reconciling versions is a pretty annoying problem, I meet it again and again.
Currently I try to use pytorch2.3.1 with cuda 11.8 , python 3.11.2 . It seems like I cannot get rid of a warning ( UserWarning: Failed to initialize NumPy: _ARRAY_API not found (Triggered internally at ..\torch\csrc\utils\tensor_numpy.cpp:84 ).
Id guess its caused by an incorrect numpy version. Is there a place to look up what combination of torch-cuda-python-numpy is ok and which is not?
how to find what is the latest version of python that pytorch - Stack Overflow
Unable to install Pytorch on Python 3.13
Compatibility of Python 3.12 with (py)torch,
Best Python Version for PyTorch Compatibility - PyTorch Forums
Videos
Pytorch supports Python 3.10.
Python 3.11 isn't fully supported yet.
You can always check torch archive or torch nightly to see if your desired version is supported.
While the Python3.11 is not officially supported as of now (Feb 11, 2023), if you are on Linux you can install the Python3.11 version of Pytorch 1.13.1:
wget https://download.pytorch.org/whl/cu117/torch-1.13.1%2Bcu117-cp311-cp311-linux_x86_64.whl
pip3 install torch-1.13.1+cu117-cp311-cp311-linux_x86_64.whl
Just note that this is not yet available on Windows or other major OSes.
If you want to give the new version a try on Other OSes such as Windows or Mac, you need to use the nighly builds.
For example for Windows inside powershell do :
wget https://download.pytorch.org/whl/nightly/cu117/torch-2.0.0.dev20230210%2Bcu117-cp311-cp311-win_amd64.whl -OutFile torch-2.0.0.dev20230210+cu117-cp311-cp311-win_amd64.whl
pip install torch-2.0.0.dev20230210+cu117-cp311-cp311-win_amd64.whl
» pip install torch
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch
I checked someone elses post of 2020 somewhere else and they said that will happen when your python version is too new.
There needs to be a real-time way for you guys to auto-update the compatibility for the latest version with even just a webhook.
edit: seems like 3.11 is the latest supported version?
edit2: the importance of using venv is shown to be important