在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

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