栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

Ubuntu18.04在python3.6下安装cv2

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

Ubuntu18.04在python3.6下安装cv2

Ubuntu18.04在python3.6下安装cv2
  • 目录
    • A. 安装步骤
    • B. 测试

目录

记录下ubuntu18.04 在python3.6下安装cv2 模块过程。

A. 安装步骤
  1. 安装python3-pip:
sudo apt install python3-pip
  1. 遇到The directory '/home/work/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.问题时:
 sudo chown  root /home/work/.cache/pip/http
 sudo chown  root /home/work/.cache/pip
  1. 更新pip:
sudo pip3 install --upgrade pip

  1. 加速安装cv:
sudo pip3 install -i https://pypi.tuna.tsinghua.edu.cn/simple opencv-python
B. 测试

如下,在import cv2 后未报错:

work@xxxxxxx:~$ python3
Error in sitecustomize; set PYTHonVERBOSE for traceback:
NameError: name 'reload' is not defined
Python 3.6.9 (default, Jan 26 2021, 15:33:00) 
[GCC 8.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> print(cv2.version)

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/488085.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号