Make python2.7 use the right version of opencv

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

时间: 2024-10-16 19:16:05

Make python2.7 use the right version of opencv的相关文章

CentOS6下编译安装Python2.7.6方法

关于在CentOS6下编译安装Python2.7.6的方法非常的多了,小编以前也介绍过相关的文章了,下面一聚教程小编再来为各位介绍一下吧,希望文章能帮助到各位. CentOS下面Python在升级到2.7.6的时候,没有找到安装包直接安装,只能通过源代码编译的方式来安装Python 2.7.6版本.这篇是编译和安装Python2.7.6的过程记录. CentOS系统中安装了development tools.要编译安装Python,执行下面代码:  代码如下 复制代码 $ pushd /usr/

python自动安装python2.7

#coding = utf-8 import os import sys if(os.getuid() == 0): pass else: print ("you are not root user") sys.exit(1) #version = input("please input python version (2.7/3.6)") version = 2.7 if version == 2.7: packagename = "Python-2.7

[转载]CentOS下编译安装Python2.7.6

时间 2014-05-07 16:57:53 Mitchell Chu's Blog 原文  http://blog.useasp.net/archive/2014/05/07/compile-and-install-python-2-dot-7-dot-6-on-centos.aspx 主题 Python Centos Linux命令 CentOS下面Python在升级到2.7.6的时候,没有找到安装包直接安装,只能通过源代码编译的方式来安装Python 2.7.6版本.这篇是编译和安装Pyt

Solaris 10u11 安装python2.7.10

##检查GCC版本 -bash-3.2# gcc --version gcc (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath) Copyright (C) 2004 Free Software Foundation, Inc. ##下载python编译程序 -bash-3.2# wget   --no-check-certificate ##解压缩Python -bash-3.2# gunzip Python-2.7.10.tgz  -bash-3.2#

win10系统同时安装python2和python3

1.官网下载python2和python3版本 2.安装python3,勾上Add Python3.5 to PATH,自定义选择安装目录,安装,验证:WIN+R--->cmd,输入python看看是否安装python3 3.安装python2,自定义安装目录,显示不能将路径添加到环境变量,一路next,安装 4.添加python2的安装路径和python2安装路径下的Scripts目录到系统环境变量Path中 5.修改python2的安装目录下python.exe和pythonw.exe为py

CentOS6设置Django开发环境

今天在我的Centos6.5机器上安装 Django 开发环境,在安装完使用 "django-admin.py startproject myapp" 创建应用的时候报了下面的错误 $ django-admin.py startproject myapp Traceback (most recent call last): File "/home/jhadmin/myenv/bin/django-admin.py", line 2, in <module>

[转]Installing python 2.7 on centos 6.3. Follow this sequence exactly for centos machine only

Okay for centos 6.4 also On apu.0xdata.loc, after this install was done $ which python /usr/local/bin/python $ python -V Python 2.7.3 $ ls -ltr /usr/local/bin/pyth* lrwxrwxrwx 1 root root 24 Jan 30 2013 /usr/local/bin/python -> /usr/local/bin/python2

Python从2.4平滑升级2.7及安装Django的过程

Python从2.4平滑升级2.7 阿里云的默认配置是给服务器安装python 2.6.6版本,这个版本有点蛋疼,就是它已经不支持Django1.7.如果在2.6.6下默认安装Django的话,会安装上1.7版本,然后在启动的时候,就会显示如下的错误: >>> import django Traceback (most recent call last): File "", line 1, in  File "/usr/lib/python2.6/site-

django初始化安装异常错误问题总结

一.标题:django初始化安装异常错误问题总结 二.目录 2.1 pip 安装 2.2 加载django SyntaxError: invalid syntax异常错误 2.3  运行yum报错:No module named yum处理 2.4  vimrc E488: Trailing characters:       silent  put! =infor错误 三.环境说明 3.1 Oracle VM VirtualBox Centos 6.6 精简版 端口转发 Nat上网 [[ema