简体   繁体   中英

Unable to install opencv 3.1 with python 3.5, works with 2.7 only

Today I installed python 3.5.1 with miniconda on ubuntu 15.10, it works fine. I tried to install opencv 3, so I completed task 1, and 2 from this site https://help.ubuntu.com/community/OpenCV and ran this command too: sudo apt-get install python-opencv.

After that if I tried to run python 3.5.1 with an script using opencv in terminal I got this message : Import error: no module named 'cv2' , but if I run it using sublime text, it works fine, I printed the version, so I found out sublime text uses python 2.7.10.

How can I make opencv work with python 3.5.1? I did not install python 2.7.10,and I am new to linux. If I type python into terminal it uses 3.5.1, so thats good, and I can change the sublime text too, thats not the problem. Any help is appreciated :)

I managed to do it thanks to this site: https://rivercitylabs.org/up-and-running-with-opencv3-and-python-3-anaconda-edition/ . The solution was :

conda install -c https://conda.binstar.org/menpo opencv3

Somehow I did not think, that anaconda offers opencv binaries. Great stuff

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM