open-mmlab / mmcv

OpenMMLab Computer Vision Foundation
https://mmcv.readthedocs.io/en/latest/
Apache License 2.0
5.92k stars 1.66k forks source link

[Error] #2901

Closed 11lgp closed 1 year ago

11lgp commented 1 year ago

Prerequisite

Environment

pip install -e . -v

Reproduces the problem - code sample

Using pip 23.0.1 from /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/pip (python 3.9) Obtaining file:///home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/mmcv Running command python setup.py egg_info running egg_info creating /tmp/pip-pip-egg-info-pxmd_d4t/mmcv.egg-info writing manifest file '/tmp/pip-pip-egg-info-pxmd_d4t/mmcv.egg-info/SOURCES.txt' writing manifest file '/tmp/pip-pip-egg-info-pxmd_d4t/mmcv.egg-info/SOURCES.txt' Preparing metadata (setup.py) ... done Requirement already satisfied: addict in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (2.4.0) Requirement already satisfied: mmengine>=0.3.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (0.8.4) Requirement already satisfied: numpy in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (1.24.3) Requirement already satisfied: packaging in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (23.0) Requirement already satisfied: Pillow in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (9.4.0) Requirement already satisfied: pyyaml in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (6.0.1) Requirement already satisfied: yapf in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (0.40.1) Requirement already satisfied: opencv-python>=3 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmengine>=0.3.0->mmcv==2.0.1) (4.8.0.76) Requirement already satisfied: rich in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmengine>=0.3.0->mmcv==2.0.1) (13.4.2) Requirement already satisfied: termcolor in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmengine>=0.3.0->mmcv==2.0.1) (2.1.0) Requirement already satisfied: matplotlib in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmengine>=0.3.0->mmcv==2.0.1) (3.7.1) Requirement already satisfied: tomli>=2.0.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from yapf->mmcv==2.0.1) (2.0.1) Requirement already satisfied: platformdirs>=3.5.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from yapf->mmcv==2.0.1) (3.10.0) Requirement already satisfied: importlib-metadata>=6.6.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from yapf->mmcv==2.0.1) (6.8.0) Requirement already satisfied: zipp>=0.5 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from importlib-metadata>=6.6.0->yapf->mmcv==2.0.1) (3.11.0) Requirement already satisfied: pyparsing>=2.3.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (3.0.9) Requirement already satisfied: cycler>=0.10 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (0.11.0) Requirement already satisfied: importlib-resources>=3.2.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (5 Requirement already satisfied: contourpy>=1.0.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (1.0.5) Requirement already satisfied: kiwisolver>=1.0.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (1.4.4) Requirement already satisfied: python-dateutil>=2.7 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (2.8.2) Requirement already satisfied: fonttools>=4.22.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (4.25.0) Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from rich->mmengine>=0.3.0->mmcv==2.0.1) (2.16.1) Requirement already satisfied: markdown-it-py>=2.2.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from rich->mmengine>=0.3.0->mmcv==2.0.1) (3.0.0) Requirement already satisfied: mdurl~=0.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from markdown-it-py>=2.2.0->rich->mmengine>=0.3.0->mmcv==2.0.1) ( Requirement already satisfied: six>=1.5 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib->mmengine>=0.3.0->mmcv==2.0.1 Installing collected packages: mmcv Running setup.py develop for mmcv Running command python setup.py develop running develop /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. nd pip and other standards-based tools. warnings.warn( /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build aother standards-based tools. warnings.warn( running egg_info creating mmcv.egg-info writing manifest file 'mmcv.egg-info/SOURCES.txt' writing manifest file 'mmcv.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/mmcv/setup.py", line 437, in setup( File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/init.py", line 155, in setup return distutils.core.setup(*attrs) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup return run_commands(dist) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands dist.run_commands() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands self.run_command(cmd) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command cmd_obj.run() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run self.install_for_development() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development self.run_command('build_ext') File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command cmd_obj.run() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 79, in run _build_ext.run(self) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 361, in build_extensions self._check_abi() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 696, in _check_abi check_compiler_abi_compatibility(compiler) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 265, in check_compiler_abi_compatibility if not check_compiler_ok_for_platform(compiler): File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 225, in check_compiler_ok_for_platform which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/subprocess.py", line 424, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1. error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/liguanpeng/anaconda3/envs/muzi/bin/python -c '
exec(compile('"'"''"'"''"'"'
# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
#   import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
#   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
#     manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize

try:
    import setuptools
except ImportError as error:
    print(
        "ERROR: Can not execute `setup.py` since setuptools is not available in "
        "the build environment.",
        file=sys.stderr,
    )
    sys.exit(1)

__file__ = %r
sys.argv[0] = __file__

if os.path.exists(__file__):
    filename = __file__
    with tokenize.open(__file__) as f:
        setup_py_code = f.read()
else:
    filename = "<auto-generated setuptools caller>"
    setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/mmcv/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
cwd: /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/mmcv/

error: subprocess-exited-with-error

× python setup.py develop did not run successfully. │ exit code: 1 ╰─> See above for output.

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

Reproduces the problem - command or script

pip install -e . -v

Reproduces the problem - error message

Using pip 23.0.1 from /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/pip (python 3.9) Obtaining file:///home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/mmcv Running command python setup.py egg_info running egg_info creating /tmp/pip-pip-egg-info-pxmd_d4t/mmcv.egg-info writing manifest file '/tmp/pip-pip-egg-info-pxmd_d4t/mmcv.egg-info/SOURCES.txt' writing manifest file '/tmp/pip-pip-egg-info-pxmd_d4t/mmcv.egg-info/SOURCES.txt' Preparing metadata (setup.py) ... done Requirement already satisfied: addict in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (2.4.0) Requirement already satisfied: mmengine>=0.3.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (0.8.4) Requirement already satisfied: numpy in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (1.24.3) Requirement already satisfied: packaging in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (23.0) Requirement already satisfied: Pillow in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (9.4.0) Requirement already satisfied: pyyaml in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (6.0.1) Requirement already satisfied: yapf in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmcv==2.0.1) (0.40.1) Requirement already satisfied: opencv-python>=3 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmengine>=0.3.0->mmcv==2.0.1) (4.8.0.76) Requirement already satisfied: rich in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmengine>=0.3.0->mmcv==2.0.1) (13.4.2) Requirement already satisfied: termcolor in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmengine>=0.3.0->mmcv==2.0.1) (2.1.0) Requirement already satisfied: matplotlib in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from mmengine>=0.3.0->mmcv==2.0.1) (3.7.1) Requirement already satisfied: tomli>=2.0.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from yapf->mmcv==2.0.1) (2.0.1) Requirement already satisfied: platformdirs>=3.5.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from yapf->mmcv==2.0.1) (3.10.0) Requirement already satisfied: importlib-metadata>=6.6.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from yapf->mmcv==2.0.1) (6.8.0) Requirement already satisfied: zipp>=0.5 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from importlib-metadata>=6.6.0->yapf->mmcv==2.0.1) (3.11.0) Requirement already satisfied: pyparsing>=2.3.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (3.0.9) Requirement already satisfied: cycler>=0.10 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (0.11.0) Requirement already satisfied: importlib-resources>=3.2.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (5 Requirement already satisfied: contourpy>=1.0.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (1.0.5) Requirement already satisfied: kiwisolver>=1.0.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (1.4.4) Requirement already satisfied: python-dateutil>=2.7 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (2.8.2) Requirement already satisfied: fonttools>=4.22.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from matplotlib->mmengine>=0.3.0->mmcv==2.0.1) (4.25.0) Requirement already satisfied: pygments<3.0.0,>=2.13.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from rich->mmengine>=0.3.0->mmcv==2.0.1) (2.16.1) Requirement already satisfied: markdown-it-py>=2.2.0 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from rich->mmengine>=0.3.0->mmcv==2.0.1) (3.0.0) Requirement already satisfied: mdurl~=0.1 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from markdown-it-py>=2.2.0->rich->mmengine>=0.3.0->mmcv==2.0.1) ( Requirement already satisfied: six>=1.5 in /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages (from python-dateutil>=2.7->matplotlib->mmengine>=0.3.0->mmcv==2.0.1 Installing collected packages: mmcv Running setup.py develop for mmcv Running command python setup.py develop running develop /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/easy_install.py:156: EasyInstallDeprecationWarning: easy_install command is deprecated. nd pip and other standards-based tools. warnings.warn( /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build aother standards-based tools. warnings.warn( running egg_info creating mmcv.egg-info writing manifest file 'mmcv.egg-info/SOURCES.txt' writing manifest file 'mmcv.egg-info/SOURCES.txt' running build_ext Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/mmcv/setup.py", line 437, in setup( File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/init.py", line 155, in setup return distutils.core.setup(*attrs) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 148, in setup return run_commands(dist) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 163, in run_commands dist.run_commands() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands self.run_command(cmd) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command cmd_obj.run() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run self.install_for_development() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development self.run_command('build_ext') File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command self.distribution.run_command(command) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 986, in run_command cmd_obj.run() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 79, in run _build_ext.run(self) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 339, in run self.build_extensions() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 361, in build_extensions self._check_abi() File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 696, in _check_abi check_compiler_abi_compatibility(compiler) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 265, in check_compiler_abi_compatibility if not check_compiler_ok_for_platform(compiler): File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/site-packages/torch/utils/cpp_extension.py", line 225, in check_compiler_ok_for_platform which = subprocess.check_output(['which', compiler], stderr=subprocess.STDOUT) File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/subprocess.py", line 424, in check_output return run(popenargs, stdout=PIPE, timeout=timeout, check=True, File "/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/subprocess.py", line 528, in run raise CalledProcessError(retcode, process.args, subprocess.CalledProcessError: Command '['which', 'g++']' returned non-zero exit status 1. error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/liguanpeng/anaconda3/envs/muzi/bin/python -c '
exec(compile('"'"''"'"''"'"'
# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
#   import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
#   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
#     manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize

try:
    import setuptools
except ImportError as error:
    print(
        "ERROR: Can not execute `setup.py` since setuptools is not available in "
        "the build environment.",
        file=sys.stderr,
    )
    sys.exit(1)

__file__ = %r
sys.argv[0] = __file__

if os.path.exists(__file__):
    filename = __file__
    with tokenize.open(__file__) as f:
        setup_py_code = f.read()
else:
    filename = "<auto-generated setuptools caller>"
    setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/mmcv/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
cwd: /home/liguanpeng/anaconda3/envs/muzi/lib/python3.9/mmcv/

error: subprocess-exited-with-error

× python setup.py develop did not run successfully. │ exit code: 1 ╰─> See above for output.

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

Additional information

No response

11lgp commented 1 year ago

我想问问这个错误该如何解决呢

zhouzaida commented 1 year ago

你是希望源码安装 mmcv 么?如果不是,可以使用 openmim 来简化安装流程。

pip install -U openmim
mim install mmcv

如果你是希望源码安装 mmcv,从错误的信息上看应该是 gcc 没有安装(或者配置)。