Conda环境pip安装ultralytics报错:ultralytics非有效可编辑依赖
解决
pip install -qe ultralytics的可编辑依赖报错问题 问题场景
- 环境:Python 3.10.8 的 conda 环境
- 执行操作:
git clone https://github.com/ultralytics/ultralyticspip 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:进入仓库目录后安装
- 切换到克隆好的仓库文件夹:
cd ultralytics - 执行可编辑安装:
若需要静默安装,保留pip install -e .-q参数即可:pip install -qe .
方式2:直接指定相对/绝对路径(无需进入目录)
- 相对路径写法:
pip install -e ./ultralytics - 绝对路径写法(替换为你实际的仓库路径):
pip install -e /Users/yourname/Documents/ultralytics
额外注意
确保当前conda环境已激活,避免安装到系统默认Python环境中。
内容的提问来源于stack exchange,提问作者thestruggleisreal
相关产品推荐
相关产品推荐

