ooking in indexes: https://mirrors.aliyun.com/pypi/simple/ Collecting PyTorch Downloading https://mirrors.aliyun.com/pypi/packages/ee/67/f403d4ae6e9cd74b546ee88cccdb29b8415a9c1b3d80aebeb20c9ea91d96/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 "/tmp/pip-install-r4o8v39w/pytorch_457f0152e72341b5b9b07d499bcd964b/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 ERROR: Could not build wheels for PyTorch, which is required to install pyproject.toml-based projects 怎么处理?
时间: 2024-04-28 08:21:01 浏览: 337
根据错误信息显示,你尝试安装的是名为“PyTorch”的包,但是正确的包名是“torch”。可以通过以下步骤解决这个问题:
1. 确认你要安装的 PyTorch 版本,访问官方网站或者文档,查看正确的包名和安装方法。
2. 使用正确的包名尝试重新安装 PyTorch。建议使用命令行安装,可以在终端中输入以下命令:
```
pip install torch
```
3. 如果仍然无法安装成功,可以尝试使用其他镜像源,例如清华大学镜像源:
```
pip install -i https://pypi.tuna.tsinghua.edu.cn/simple torch
```
希望这些方法能够帮助你解决问题。
阅读全文