终端提示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 "" , line 2, in
File "" , line 34, in
File "/private/var/folders/39/stsvvgr94d32v12wspl_45dh0000gn/T/pip-install-99p99nhy/pytorch_a70f6066d2404febba90f55b261b377e/setup.py", line 15, in
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 "" , line 2, in
File "" , line 34, in
File "/private/var/folders/39/stsvvgr94d32v12wspl_45dh0000gn/T/pip-install-99p99nhy/pytorch_a70f6066d2404febba90f55b261b377e/setup.py", line 11, in
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 [-n=] [--encoding=] [--no-more]
没有任何方案……
UltralyticsYolo v8
安装成功并可以使用
正确的包名应该是torch,而不是pytorch。安装导致错误的可能。
应该使用命令pip install torch来安装PyTorch。
可以使用以下命令来安装 PyTorch:
pip3 install torch
pip3 install torchvision
请改正安装的名称为 "torch",不是 "pytorch"。安装完PyTorch之后,再尝试安装 UltralyticsYolo v8。