【已解决】ERROR: No matching distribution found for torch.安装torch一次性解决方法

建议收藏这个方法,python pip 安装依赖失败,多数都可以通过这个方法解决

文章目录

环境

python 安装 torch


异常

bash 复制代码
(base) ➜  ComfyUI git:(master) pip install -i https://pypi.mirrors.ustc.edu.cn/simple torch
Looking in indexes: https://pypi.mirrors.ustc.edu.cn/simple
ERROR: Could not find a version that satisfies the requirement torch (from versions: none)
ERROR: No matching distribution found for torch

原因

无法拉取,可能是镜像问题


直接解决方案

手动下载到本地,本地安装。

下载地址:(选择对应操作系统、系统架构和 python版本的依赖)

bash 复制代码
https://download.pytorch.org/whl/torch_stable.html

命令

bash 复制代码
pip install ~/Downloads/torch-1.9.1-cp39-none-macosx_11_0_arm64.whl

解释:(一定选择对应版本的依赖,如果找不到对应依赖,可以升降 python 版本)

bash 复制代码
torch-1.9.1-cp39-none-macosx_11_0_arm64.whl

cp39: 指 python3.9

macosx: 操作系统

arm64: 系统架构

成功

Web UI 地址 :

bash 复制代码
http://127.0.0.1:8188/

启动日志:

UI 界面效果:

相关推荐
花酒锄作田1 小时前
使用 pkgutil 实现动态插件系统
python
前端付豪5 小时前
LangChain链 写一篇完美推文?用SequencialChain链接不同的组件
人工智能·python·langchain
曲幽6 小时前
FastAPI实战:打造本地文生图接口,ollama+diffusers让AI绘画更听话
python·fastapi·web·cors·diffusers·lcm·ollama·dreamshaper8·txt2img
老赵全栈实战6 小时前
Pydantic配置管理最佳实践(一)
python
阿尔的代码屋12 小时前
[大模型实战 07] 基于 LlamaIndex ReAct 框架手搓全自动博客监控 Agent
人工智能·python
AI探索者1 天前
LangGraph StateGraph 实战:状态机聊天机器人构建指南
python
AI探索者1 天前
LangGraph 入门:构建带记忆功能的天气查询 Agent
python
FishCoderh1 天前
Python自动化办公实战:批量重命名文件,告别手动操作
python
躺平大鹅1 天前
Python函数入门详解(定义+调用+参数)
python
曲幽1 天前
我用FastAPI接ollama大模型,差点被asyncio整崩溃(附对话窗口实战)
python·fastapi·web·async·httpx·asyncio·ollama