码迷,mamicode.com
首页 > 编程语言 > 详细

Make python2.7 use the right version of opencv

时间:2017-01-26 07:43:01      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:perl   tac   ref   different   python   command   test   opencv   bsp   

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 version in python2.7. It is wired and anoiying. Also it is normal in C++.

This bug is quite similar with this one: opencv have 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 is 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 that symbolic link with ‘rm‘ and create a new one with this command:

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

here it shall be

  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

标签:perl   tac   ref   different   python   command   test   opencv   bsp   

原文地址:http://www.cnblogs.com/casperwin/p/6351224.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!