Install OpenCV-Python in Ubuntu
- 之前安装python版opencv,需要下载whl文件,进行安装,这是在window环境下的:
- 安装opencv_python,下载whl包
安装系统python下的opencv
今天发现一个简单的方法。
Install package python-opencv with following command in terminal (as root user).
$ sudo apt-get install python-opencv
Open Python IDLE (or IPython) and type following codes in Python terminal.
import cv2 as cv
print(cv.__version__)
If the results are printed out without any errors, congratulations !!! You have installed OpenCV-Python successfully.
针对conda环境下env安装python-opencv
- 发现有些坑
- 首先,我们直接编译opencv应该就有python的接口:/usr/local/lib/python3.5/dist-packages;发现有
cv2.cpython-35m-x86_64-linux-gnu.so
文件,说的直接拷贝到env下的site-packages,结果报错
; - 然后我们本身直接
sudo apt-get install python-opencv
安装的是直接可以使用的; - sudo直接安装按系统默认的python2.7上:
/usr/lib/python2.7/dist-packages
下面有cv2.x86_64-linux-gnu.so;
rjw@rjw:~$ /usr/bin/python
Python 2.7.12 (default, Dec 4 2017, 14:50:18)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'2.4.9.1'
中间还有错: Python 3.5 ImportError: dynamic module does not define module export function (PyInit_cv2)
参考的方法: Linux下安装python-opencv
最终解决方法:
conda install -c menpo opencv3
:Mac+anaconda+python3.6安装opencv3
(tensorflow) rjw@rjw:~$ python
Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 21:41:56)
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.2.0'
直接
conda install python-opencv
在conda环境下找不到包update2018.11.11;今天遇到个问题:
UnsatisfiableError: The following specifications were found to be in conflict: - opencv3 -> python
- 重新使用:
pip install opencv-python
(maskrcnn_benchmark) rjw@rjw:~/desktop$ pip install opencv-python
Collecting opencv-python
Downloading https://files.pythonhosted.org/packages/d2/cf/1e5774811aa1b656fba8476e98edab2f99a7683c3aaeede057cdc9959c24/opencv_python-3.4.3.18-cp37-cp37m-manylinux1_x86_64.whl (25.0MB)
100% |████████████████████████████████| 25.0MB 72kB/s
Requirement already satisfied: numpy>=1.14.5 in /home/rjw/anaconda3/envs/maskrcnn_benchmark/lib/python3.7/site-packages (from opencv-python) (1.15.4)
Installing collected packages: opencv-python
Successfully installed opencv-python-3.4.3.18
- 可以想想,在anaconda下怎么使用自己编译的opencv,这样就可以万能使用!!!
其他错误
- 遇到下面问题,使用
conda install -c asmeurer pango
,参考github:Qt fails in GNOME/Fedora 22
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0: undefined symbol: hb_font_funcs_set_variation_glyph_func
Install OpenCV-Python in Ubuntu的更多相关文章
- install stackless python on ubuntu
前言 我准备用stackless模拟游戏玩家登陆/注册等行为,测试游戏服务器的性能. 但是在安装stackless的过程中遇到了很多问题,特此记录下来,也分享给需要的朋友. 关于stackless S ...
- Install OpenCV on Ubuntu or Debian
http://milq.github.io/install-OpenCV-ubuntu-debian/转注:就用第一个方法吧,第二个方法的那个sh文件执行失败,因为我价格kurento.org的源,在 ...
- Install OpenCV 3.0 and Python 2.7+ on Ubuntu
为了防止原文消失或者被墙,转载留个底,最好还是去看原贴,因为随着版本变化,原贴是有人维护升级的 http://www.pyimagesearch.com/2015/06/22/install-Open ...
- Install OpenCV 3.0 and Python 2.7+ on OSX
http://www.pyimagesearch.com/2015/06/15/install-OpenCV-3-0-and-Python-2-7-on-osx/ As I mentioned las ...
- Ubuntu 16.04: How to install OpenCV
参考:https://www.pyimagesearch.com/2016/10/24/ubuntu-16-04-how-to-install-opencv/ 步骤# 1:安装opencv的依赖项 本 ...
- Ubuntu系统---安装Caffe (+OpenCV+Python+CPU-only)
安装配置Ubuntu14.04+Caffe (+OpenCV+Python+CPU-only) 记录 [作者:Wu Ping.时间:20180428.] 本人已经安装很多次的Caffe了:从开始的初探 ...
- ubuntu14 opencv python 安装
本文记录了Ubuntu 14.04下使用源码手动安装OpenCV 3.0的过程.此外记录了在Python中安装及载入OpenCV的方法. 1.安装OpenCV所需的库(编译器.必须库.可选库) GCC ...
- [OpenCV] Install OpenCV 3.3 with DNN
OpenCV 3.3 Aug 3, 2017 OpenCV 3.3 has been released with greatly improved Deep Learning module and l ...
- [OpenCV] Install OpenCV 3.4 with DNN
目标定位 一.开始全面支持 Tensorflow OpenCV3.4 新功能 当前最新进展OpenCV 3.4 dev:https://github.com/opencv/opencv/tree/ma ...
- Erlang/Elixir: 使用 OpenCV, Python 搭建图片缩略图服务器
这篇文章是在OSX上测试和运行的的, Ubuntu下的安装和配置请移步到这里 应用程序进程树, 默认 Poolboy 中初始化10个用于处理图片的 Python 工作进程(Worker) 首先安装Op ...
随机推荐
- InvokeRepeating重复定时器
JS // Starting in 2 seconds.// a projectile will be launched every 0.3 secondsvar projectile : Rigid ...
- 吴恩达-coursera-机器学习-week8
十三.聚类(Clustering) 13.1 无监督学习:简介 13.2 K-均值算法 13.3 优化目标 13.4 随机初始化 13.5 选择聚类数 十四.降维(Dimensionality Red ...
- JDK版本的特性
1. 2.JDK1.5增加的是: (1) 泛型与枚举类型(枚举类型是静态,常量.里面也可以包含构造方法,成员方法,但是构造方法一定是私有的. 适合枚举的是 有限数据,封装特定的数据,), (2)注解( ...
- Western Subregional of NEERC, Minsk, Wednesday, November 4, 2015 Problem C. Cargo Transportation 暴力
Problem C. Cargo Transportation 题目连接: http://opentrains.snarknews.info/~ejudge/team.cgi?SID=c75360ed ...
- .babelrc文件的一些简单的配置
首先现在根目录先生存.babelrc文件 这个文件是用来设置转码的规则和插件的 如果想使用es6语法,必须安装插件 npm install babel-preset-es2015 { "pr ...
- OpenVPN选项topology subnet实现子网掩码24的子网地址扩展
首先,在国内的文章中都没有提及这个概念,到时很多人生成的VPN服务端配置分配的IP都采用net30这种形式,这就导致了在任何一台VPN客户端上无法实现路由指向,因为子网掩码30换算出来就两个地址. t ...
- MikroTik RouterOS安装后初始化配置(PPPOE拨号上网)
1.修改登入密码 路由器默认登入账号为admin,密码为空,强烈建议修改登入密码保证安全: 2.修改接口名称 选择Interface,切换到Ethernet标签,找到状态是R(run)的两个端口. 给 ...
- CRC 概述
Acquired from: ftp.adelaide.edu.au:/pub/rocksoft/crc_v3.txt or ftp://ftp.rocksoft.com/papers/crc_v3. ...
- svn 迁移到 git 仓库并保留 commit 历史记录
1.svn 转换为 git(会提示,让你输入先前 svn 的账号与密码) # 切换至 本地项目目录 cd /Users/jianbao/PhpStormProjects/fiisoo/ # 克隆 sv ...
- 没有可用的复制构造函数或复制构造函数声明为“explicit”
c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\vector(810) : error C2558: str ...