1.安装编译相关工具
yum -y groupinstall "Development tools" 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 wget yum install libffi-devel -y
2.下载安装包解压,编译
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tar.xz tar -xvJf Python-3.7.0.tar.xz mkdir /usr/local/python3 #创建编译安装目录 cd Python-3.7.0 ./configure --prefix=/usr/local/python3 make && make install
3.创建软连接并验证是否成功
ln -s /usr/local/python3/bin/python3 /usr/local/bin/python3 ln -s /usr/local/python3/bin/pip3 /usr/local/bin/pip3 python3 -V pip3 -V
4.下载并安装
cd /root git clone #或者 git clone https://gitee.com/alisen39/TrWebOCR.git cd chineseocr_lite #相应目录 pip install --upgrade pip pip3 install --upgrade pip pip3 install -r requirements.txt python3 backend/main.py --port=8089
其他依赖错误:
yum install libSM-1.2.2-2.el7.x86_64 --setopt=protected_multilib=false yum install libXext-1.3.3-3.el7.x86_64 libstdc++.so.6.0.25 需要下载正确的版本 到vps里的 /lib64 目录下,并做软链接 ln -s libstdc++.so.6.0.25 libstdc++.so.6