Install OpenCv for python in Linux
2018-03-29 21:43
274 查看
Open cv is a powerful tool for image processing!
I’ll guided you to install open cv for python in Linux platform.
But this may not work, since in Linux, a lot of differences existed.
You may meet this mistakes:
If so, you should use
https://devtalk.nvidia.com/default/topic/986950/opencv-installation-problem-nppigraphcutinitalloc-not-declared/
This is caused by the Incompatible between
To solve this:
Modify
In detail:
change
to
Then, re-make. I passed.
But I still can’t
To solve this, I used
Thing done!
I’ll guided you to install open cv for python in Linux platform.
0. Anaconda
If you installedAnacondain you computer, you may install
opencvby this command:
conda install opencv
But this may not work, since in Linux, a lot of differences existed.
You may meet this mistakes:
Thefunction is not implemented. Rebuild the library with Windows, GTK+ 2.x orCarbon support. If you are on Ubuntu or Debian, install libgtk2.0‑dev and pkg‑config, then re‑runcmake or configure script
If so, you should use
conda uninstall opencvand then go to the following steps.
1. Follow the official guidance
https://docs.opencv.org/trunk/d2/de6/tutorial_py_setup_in_ubuntu.html2. Refer to website
https://jingyan.baidu.com/article/14bd256e466474bb6d2612db.html3. Mistakes I meet
3.1 ‘NppiGraphcutState’
When I reached 95, I got‘NppiGraphcutState’ has not been declaredas the follow website
https://devtalk.nvidia.com/default/topic/986950/opencv-installation-problem-nppigraphcutinitalloc-not-declared/
This is caused by the Incompatible between
cuda8.0and
opencv2(or
opencv3).
To solve this:
Modify
opencv-3.0.0/modules/cudalegacy/src/graphcuts.cppfile.
In detail:
change
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)
to
#if !defined (HAVE_CUDA) || defined (CUDA_DISABLER)|| (CUDART_VERSION >= 8000)
Then, re-make. I passed.
3.1 import error
Even I finished make process and I also didsudo /bin/bash -c 'echo "/usr/local/lib" > /etc/ld.so.conf.d/opencv.conf' sudo ldconfig
But I still can’t
import cv2in python.
To solve this, I used
cd /home/xx/anaconda2/lib/python2.7/site-packages/ ln -s /usr/local/lib/python2.7/site-packages/cv2.so cv2.so
Thing done!
相关文章推荐
- How to install oracle 10g for Linux in ubuntu
- Code a network packet sniffer in python for Linux
- python pip install 报错TypeError: unsupported operand type(s) for -=: 'Retry' and 'int' Command "python setup.py egg_info" failed with error code 1 in
- install python in linux
- Install Rouge and Pyrouge for python 2.7 (conda virtual env) on Linux 64
- How to install opencv in python
- How to install Homebrew, OpenCV and Python for OS X El Capitan (10.11)
- OpenCV——Install in Linux OS
- How install support tool for linux system in vmware
- How can I install Easy_Install for Python 2.6.4 in Mac OSX 10.4.11【转】
- opencv for python on ubuntu linux 环境搭建
- How to Install VM Tools for Linux Platform in VMware Workstation
- Install openCV in Linux
- Code a network packet sniffer in python for Linux
- windows 10中的ubuntu子系统安装桌面环境的方法(How to install Ubuntu-desktop in windows 10 Subsystem for Linux)
- python install in linux
- install python 3.2, django and eclipse pydev plugin in mac for python devolopment
- How to install and manage different versions of Python in Linux
- 转载:Setup OpenCV for Python in Windows
- [Tip] Install OpenCV3.0.0 for python3.4.3 under ubuntu15.04