报错:pip download failed with args: ['mmdet==2.25.0', '-d', '/tmp/tmphfqfpuc',…
- User
报错:pip download failed with args: ['mmdet==2.25.0', '-d', '/tmp/tmphf_qfpuc', '--no-deps', '--no-binary', ':all:', '-i', 'https://pypi.tuna.tsinghua.edu.cn/simple'] ERROR: Exception: Traceback (most recent call last): File "/home/heyuting/anaconda3/envs/event/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 180, in exc_logging_wrapper status = run_func(*args) File "/home/heyuting/anaconda3/envs/event/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 245, in wrapper return func(self, options, args) File "/home/heyuting/anaconda3/envs/event/lib/python3.8/site-packages/pip/_internal/commands/download.py", line 142, in run requirement_set.warn_legacy_versions_and_specifiers() File "/home/heyuting/anaconda3/envs/event/lib/python3.8/site-packages/pip/_internal/req/req_set.py", line 104, in warn_legacy_versions_and_specifiers for dep in req.get_dist().iter_dependencies(): File "/home/heyuting/anaconda3/envs/event/lib/python3.8/site-packages/pip/_internal/metadata/pkg_resources.py", line 221, in iter_dependencies return self._dist.requires(extras) File "/home/heyuting/anaconda3/envs/event/lib/python3.8/site-packages/mim/commands/install.py", line 207, in patched_requires mmdeps_text = get_mmdeps_from_mmpkg(self.project_name, File "/home/heyuting/anaconda3/envs/event/lib/python3.8/site-packages/mim/commands/install.py", line 321, in get_mmdeps_from_mmpkg mminstall_content = get_mminstall_from_pypi(mmpkg, index_url=index_url) File "/home/heyuting/anaconda3/envs/event/lib/python3.8/site-packages/mim/commands/install.py", line 351, in get_mminstall_from_pypi exit(status_code) File "/home/heyuting/anaconda3/envs/event/lib/python3.8/_sitebuiltins.py", line 26, in call raise SystemExit(code) SystemExit: 2
- Assistant
这个错误信息表明在使用
pip从指定源(Tsinghua镜像)下载mmdet==2.25.0时发生了异常,具体原因是mim(Model Installer for MMDetection and other OpenMMLab projects) 中的一些内部实现导致了SystemExit异常。这个问题可能是由于mim包中的某个函数对 Python 解释器调用exit方法,而引发了异常。以下是一些可能的解决方案:
1. 更新
mim包确保你使用的是最新版本的
mim,它可能已经解决了你的问题。你可以通过以下命令更新mim包:shpip install --upgrade mim2. 手动安装
你也可以尝试先下载
.whl文件并手动安装。先用
pip下载.whl文件:shpip download mmdet==2.25.0 -d /tmp/tmphf_qfpuc --no-deps -i https://pypi.tuna.tsinghua.edu.cn/simple然后,从下载的文件目录中直接安装:
shpip install --no-deps /tmp/tmphf_qfpuc/mmdet-2.25.0-py3-none-any.whl3. 使用官方源