在arm64上 pip安装 opencv

4,205 阅读1分钟

问题

在aarch64上安装:pip3 install opencv-python 报下面的错误:

File "/usr/local/lib/python3.6/dist-packages/skbuild/cmaker.py", line 82, in get_cmake_version
      "Problem with the CMake installation, aborting build. CMake executable is %s" % cmake_executable)
  Traceback (most recent call last):
  
  Problem with the CMake installation, aborting build. CMake executable is cmake

原因

在aarch64安装opencv需要编译,需要安装 pip install cmake,但是pypi中的cmake程序是x86的

解决方式

apt install cmake
pip install cmake
ln -sf /usr/bin/cmake /usr/local/lib/python3.6/dist-packages/cmake/data/bin/cmake
ln -sf /usr/bin/cmake /usr/local/lib/python3.6/dist-packages/cmake/data/bin/ctest
ln -sf /usr/bin/cmake /usr/local/lib/python3.6/dist-packages/cmake/data/bin/cpack