Make python2.7 use the right version of OpenCV

Source: Internet
Author: User

Bug:

Some day I updated my OpenCV to the latest version 2.4.13, while recently I found I always get "2.4.8" When I check the VE Rsion in python2.7. It is wired and anoiying. Also it is normal in C + +.

This bug was quite similar with this ONE:OPENCV has different version with Python module. Luckily the answer works. Also refer to Pyimagesearch article-install OpenCV 3.0 and Python 2.7+ on Ubuntu.

Fix:

It's related to the symbolically link problem. I was wasting time reinstalling openCV-2.4.13 for several times.

In all, after installing the new version of OpenCV, one more step is needed. We need to symbolically link our newly created library file-cv2.so-to our Python package path.

Let ' s say

/usr/local/lib/python2.7/site-packages/cv2.so:symbolic link to '/usr/lib/python2.7/dist-packages/cv2.so '

Which is usually the case.

We need to remove the symbolic link with the ' RM ' and create a new one with the This command:

  Ln-s ~path to your new cv2.so file ~/usr/local/lib/python2.7/site-packages/cv2.so

Here it shall is

Ln-s/usr/local/lib/python2.7/site-packages/cv2.so ~/usr/local/lib/python2.7/site-packages/cv2.so

Make python2.7 use the right version of OpenCV

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.