在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 里面。操作如下图:
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
在这里插入图片描述
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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章