pytorch无法安装,找不到torch包

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

我正在尝试在我的windows电脑上安装pytorch/torch,我试过了

pip intall pytorch

我收到以下错误:

C:\Users\mouss>pip install pytorch
Collecting pytorch
  Using cached pytorch-1.0.2.tar.gz (689 bytes)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pytorch
  Building wheel for pytorch (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\mouss\AppData\Local\Temp\pip-install-re456wuk\pytorch_687632f0314d499d868cb85ed33f83ba\setup.py", line 15, in <module>
          raise Exception(message)
      Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pytorch
  Running setup.py clean for pytorch
Failed to build pytorch
Installing collected packages: pytorch
  Running setup.py install for pytorch ... error
  error: subprocess-exited-with-error

  × Running setup.py install for pytorch did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "C:\Users\mouss\AppData\Local\Temp\pip-install-re456wuk\pytorch_687632f0314d499d868cb85ed33f83ba\setup.py", line 11, in <module>
          raise Exception(message)
      Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> pytorch

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.


基于

Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
,我发现它的名字改成了
torch
,所以我尝试了
pip install torch

然后我得到了这个错误:

C:\Users\mouss>pip install torch
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

你知道如何在我的电脑上安装 pytorch/torch 吗?

python windows pip pytorch torch
1个回答
0
投票
pip3 install torch torchvision torchaudio --extra-index-url https://download.pytorch.org/whl/cu116 
© www.soinside.com 2019 - 2024. All rights reserved.