Failed to build pytorch Installing collected packages: pytorch, torchvision 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 36, in <module> File "<pip-setuptools-caller>", line 34, in <module> File "D:\Temp\pip-install-q_e2d0au\pytorch_d1f7371a19d8483b82d99b851a06bcb6\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.
时间: 2024-01-24 07:05:14 浏览: 475
PyTorch-1.4.0+torchvision-0.5.0.zip
这个错误提示是由于你在安装 PyTorch 时使用了错误的包名。正确的包名是 "torch" 而不是 "pytorch"。你可以使用以下命令安装 PyTorch:
```python
pip install torch torchvision
```
如果你已经安装了 PyTorch,可以使用以下命令卸载它:
```python
pip uninstall pytorch
```
然后再重新安装一次即可。
阅读全文