问题遇到的现象和发生背景
终端提示Torch
因为subprocess
没有安装成功,必须需要Torch
才能安装UltralyticsYolo v8
我去网上寻找Torch
的源代码并使用
cd Torch
python3 setup.py install
安装Torch
可是系统提示Exception: You tried to install "pytorch". The package named for PyTorch is "torch"
遇到的现象和发生背景
我想在我的MacOSX 13.2
上安装安装Ultralytics
Git
已经被init
用代码块功能插入代码
pip3 install pytorch
pip3 install torch
pip3 install torch vision
cd Torch
python3 setup.py install
运行结果及详细报错内容
➜ ~ git:(main) pip3 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 "/private/var/folders/39/stsvvgr94d32v12wspl_45dh0000gn/T/pip-install-99p99nhy/pytorch_a70f6066d2404febba90f55b261b377e/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 "/private/var/folders/39/stsvvgr94d32v12wspl_45dh0000gn/T/pip-install-99p99nhy/pytorch_a70f6066d2404febba90f55b261b377e/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.
Usage:
tail <filename> [-n=<n>] [--encoding=<encoding>] [--no-more]
我的解答思路和尝试过的方法
没有任何方案……
我想要达到的结果
UltralyticsYolo v8
安装成功并可以使用