问题背景:

执行

pip install opencv-python

出现错误:

Traceback (most recent call last):
      File "<string>", 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
Logo

CSDN联合极客时间,共同打造面向开发者的精品内容学习社区,助力成长!

更多推荐