pip install opencv-python出现ModuleNotFoundError: No module named ‘skbuild‘错误解决方案

问题背景:

执行

pip install opencv-python

出现错误:

Traceback (most recent call last):
      File "", line 1, in <module>
      File "/tmp/pip-build-is7g9vyo/opencv-python/setup.py", line 9, in <module>
        import skbuild
    ModuleNotFoundError: No module named 'skbuild'
    
    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-is7g9vyo/opencv-python/

解决方案:

先安装:

pip install scikit-build

此时可能还会出现错误:

ImportError: libGL.so.1: cannot open shared object file: No such file or directory

再执行:

sudo apt install -y libgl1-mesa-glx libgl1-mesa-dev

你可能感兴趣的:(Python,python)