Home Arrow Icon Knowledge base Arrow Icon Global Arrow Icon Can I use PyTorch/XLA with Python 3.11


Can I use PyTorch/XLA with Python 3.11


Currently, PyTorch/XLA supports Python versions up to 3.11 for Linux distributions. However, there are specific requirements and limitations. For instance, to install `torch_xla` version 2.5, you need to ensure compatibility with Python 3.9 to 3.11, as there are no wheels available for Python 3.12 or later[3][4]. Additionally, PyTorch itself does not support Python 3.11 on Windows[7].

For PyTorch/XLA version 2.6 and beyond, there will be support for Python 3.11, including wheels built with the C++11 ABI, which can be installed using specific commands[5]. Therefore, while PyTorch/XLA can be used with Python 3.11 on Linux, it requires careful version management and installation.

Citations:
[1] https://github.com/pytorch/xla/releases
[2] https://pytorch.org/xla/release/2.0/index.html
[3] https://stackoverflow.com/questions/79314991/why-am-i-getting-no-matching-distribution-found-for-torch-xla-2-5-0-when-inst
[4] https://awsdocs-neuron.readthedocs-hosted.com/en/latest/general/appnotes/torch-neuronx/introducing-pytorch-2-x.html
[5] https://github.com/pytorch/xla
[6] https://github.com/pytorch/xla/issues/4
[7] https://discuss.pytorch.org/t/pytorch-does-not-support-python-3-11/173747
[8] https://pytorch.org/xla/master/gpu.html