安装及排错过程:
一, 安装python3.7
安装依赖包
yum -y install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
下载 https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
解压 tar -zxvf Python-3.7.0.tgz -C /usr/local
cd /usr/local
mkdir python3
cd Python-3.7.0
./configure --prefix=/usr/local/python3
make
make install
建立软链接
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python3
ln -s /usr/local/python3/bin/pip3.7 /usr/bin/pip3
但是当在python3中导入opencv库时出错
python3
import cv2
Traceback (most recent call last):
File "<stdin>", lin