How to install PyTorch on python 3.12.1

I am installing DARTS TimeSeries library (https://github.com/unit8co/darts/blob/master/INSTALL.md#enabling-optional-dependencies) but I run into an issue of dependencies installation. In the DARTS installation guide it said if we run into that issue we have to refer to the official installation guide for PyTorch, then try installing Darts again. Than, when I tried to install torch on python 3.12.1 I run into this error :

ERROR: Could not find a version that satisfies the requirement torch (from versions: none)

ERROR: No matching distribution found for torch.

How to solve that?

I am using PyCharm as Python code editor.

I tried a pip install darts and it did not install all the packages and encounter this error error: subprocess-exited-with-error

  pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [136 lines of output]
      Collecting setuptools>=64.0
        Obtaining dependency information for setuptools>=64.0 from https://files.pythonhosted.org/packages

Then, I tried to install torch with pip install torch and encountered this error
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

Both packages darts and pytorch currently supports Python versions 3.8 – 3.10 but you’re using Python 3.12.1 To resolve your issue, install a supported python version and use virtual environments to manage projects that requires specific python versions. For example, you can create a Python 3.10 virtual environment and pip install darts there.

Leave a Comment