如何在python 3.12.1上安装PyTorch

问题描述 投票:0回答:1

我正在安装 DARTS TimeSeries 库(https://github.com/unit8co/darts/blob/master/INSTALL.md#enabling-optional-dependencies),但我遇到了依赖项安装问题。在 DARTS 安装指南中,它说如果我们遇到这个问题,我们必须参考 PyTorch 的官方安装指南,然后尝试再次安装 Darts。然后,当我尝试在 python 3.12.1 上安装 torch 时,我遇到了这个错误:

错误:找不到满足火炬要求的版本(来自版本:无)

错误:找不到火炬的匹配发行版。

如何解决?

我使用 PyCharm 作为 Python 代码编辑器。

我尝试了

pip install darts
,但它没有安装所有软件包并遇到此错误错误: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

然后,我尝试使用 pip install torch 来安装 torch 并遇到了这个错误 错误:找不到满足火炬要求的版本(来自版本:无) 错误:找不到火炬的匹配发行版

python torch ml
1个回答
2
投票

两个包 dartspytorch 目前都支持 Python 版本 3.8 - 3.10,但您使用的是 Python 3.12.1 要解决您的问题,请安装受支持的 python 版本并使用虚拟环境来管理需要特定 python 版本的项目。例如,您可以创建一个 Python 3.10 虚拟环境并在那里

pip install darts

© www.soinside.com 2019 - 2024. All rights reserved.