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

Ubuntu远程机安装YOLOX遇requirements.txt缺失错误,求解决

解决Ubuntu远程机器安装YOLOX时requirements.txt缺失的问题

问题描述

在Ubuntu远程机器执行pip install yolox命令时,出现如下错误:

Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
Traceback (most recent call last):
File "", line 2, in
File "", line 34, in
File "/tmp/pip-install-e8uz9eo5/yolox_dd607ece87a3411aabef0d9d5bff591a/setup.py", line 77, in
install_requires=get_install_requirements(),
File "/tmp/pip-install-e8uz9eo5/yolox_dd607ece87a3411aabef0d9d5bff591a/setup.py", line 49, in get_install_requirements
with open("requirements.txt", "r", encoding="utf-8") as f:
FileNotFoundError: [Errno 2] No such file or directory: 'requirements.txt'
[end of output]

note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

解决方法

方法一:从官方源码克隆安装(推荐)

PyPI上的YOLOX包可能存在打包缺陷,直接从官方源码仓库安装更可靠:

  • 克隆源码仓库:
    git clone https://github.com/Megvii-BaseDetection/YOLOX.git
    
  • 进入仓库目录:
    cd YOLOX
    
  • 安装依赖:
    pip install -r requirements.txt
    
  • 安装YOLOX(开发模式,支持后续修改源码):
    pip install -v -e .
    
    若不需要开发模式,可执行:
    pip install .
    

方法二:安装指定稳定版本

尝试安装PyPI上的历史稳定版本,部分版本的打包可能不存在该问题,例如:

pip install yolox==0.3.0

可根据实际情况尝试不同版本号。

内容的提问来源于stack exchange,提问作者Jalil Nourmohammadi Khiarak

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.07.22 02:50:33