Ubuntu 16.04 LTS上使用Python3版本的PIP

Ubuntu 16.04 LTS上使用Python2Python3是共存的,而且默认使用Python2,如果使用Python3则需要明确指定。

1.安装Python3版本的PIP

$ sudo apt-get install python3-pip

$ sudo pip3 install --upgrade pip

2.安装Python3版本的NumPy

$ pip3 install numpy

3.安装Python3版本的OpenCV

$ sudo pip3 install opencv-python

注意,目前的Python3版本的OpenCV是不支持cv2.imshow()的,具体查看https://pypi.python.org/pypi/opencv-python,可以看到如下信息:

**Q: Why I can't open GUI windows (``cv2.imshow()``) on GNU/Linux distribution X or on macOS?**

A: Like above, OpenCV was not compiled against GTK or Carbon. Support for these might be added in the future.

发布者

发表回复

您的电子邮箱地址不会被公开。 必填项已用 * 标注