You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Conda环境pip安装ultralytics报错:ultralytics非有效可编辑依赖

解决pip install -qe ultralytics的可编辑依赖报错问题

问题场景

  • 环境:Python 3.10.8 的 conda 环境
  • 执行操作:
    1. git clone https://github.com/ultralytics/ultralytics
    2. pip install -qe ultralytics
  • 报错信息:

ERROR: ultralytics is not a valid editable requirement. It should either be a path to a local project or a VCS URL (beginning with bzr+http, bzr+https, bzr+ssh, bzr+sftp, bzr+ftp, bzr+lp, bzr+file, git+http, git+https, git+ssh, git+git, git+file, hg+file, hg+http, hg+https, hg+ssh, hg+static-http, svn+ssh, svn+http, svn+https, svn+svn, svn+file).

问题原因

报错核心是pip install -qe后直接写ultralytics不符合可编辑安装的规则,它需要指向本地项目的路径(相对或绝对),而非包名。

解决步骤

方式1:进入仓库目录后安装

  1. 切换到克隆好的仓库文件夹:
    cd ultralytics
    
  2. 执行可编辑安装:
    pip install -e .
    
    若需要静默安装,保留-q参数即可:
    pip install -qe .
    

方式2:直接指定相对/绝对路径(无需进入目录)

  • 相对路径写法:
    pip install -e ./ultralytics
    
  • 绝对路径写法(替换为你实际的仓库路径):
    pip install -e /Users/yourname/Documents/ultralytics
    

额外注意

确保当前conda环境已激活,避免安装到系统默认Python环境中。

内容的提问来源于stack exchange,提问作者thestruggleisreal

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.04 21:20:41