在UOS20-龙芯(MIPS64EL)上安装 opencv-python

  1. 使用pip 安装
$ pip install opencv-python
Defaulting to user installation because normal site-packages is not writeable
ERROR: Could not find a version that satisfies the requirement opencv-python (from versions: none)
ERROR: No matching distribution found for opencv-python

安装失败提示到不到。
上 https://pypi.org/ 查找,得到的是结果这个是非官方的源,是爱好者个人维护,所以pip 没有自动下载源码,因为上面没提供源码。源码在作者的github 里面。操作如下图:
在UOS20-龙芯(MIPS64EL)上安装 opencv-python_第1张图片
在UOS20-龙芯(MIPS64EL)上安装 opencv-python_第2张图片
在UOS20-龙芯(MIPS64EL)上安装 opencv-python_第3张图片
在UOS20-龙芯(MIPS64EL)上安装 opencv-python_第4张图片
2. 下载源码

$ git clone --depth 1 https://github.com/skvark/opencv-python.git
  1. 修改源gitee以加快代码下载速度
$ cat .gitmodules 
[submodule "opencv"]
	path = opencv
	url =  https://gitee.com/mirrors/opencv.git
[submodule "opencv_contrib"]
	path = opencv_contrib
	url = https://gitee.com/mirrors/opencv_contrib.git
[submodule "multibuild"]
	path = multibuild
	url = https://gitee.com/useptonly/multibuild.git
  1. 安装编译依赖
$ sudo apt install qt4-dev-tools qt4-qmake
$ sudo apt install cmake 
$ sudo apt install python3-numpy
$ pip install scikit-build
  1. 编译
    $ python3 setup.py bdist_wheel

  2. 编译好的文件:
    ./dist/opencv_python-4.3.0+3073e9e-cp37-cp37m-linux_mips64.whl

  3. 参考
    [1] https://stackoverflow.com/questions/10315021/installing-opencv-for-python3
    [2] https://stackoverflow.com/questions/20953273/install-opencv-for-python-3-3/21212023#21212023

你可能感兴趣的:(龙芯,python,opencv)