环境搭建:此次在Linux的centos系统下搭建。由于Python2与Python3的差异较大,为了便于维护,在版本选择上使用Python3进行搭建。\
https://www.python.org/downloads/
tar -xvzf Python-3.7.4.tgz -C .
mkdir /usr/local/python3
./configure --prefix=/usr/local/python3 --enable-shared CFLAGS=-fPIC
make && make install
mv /usr/bin/python /usr/bin/python_bak
ln -s /usr/local/python3/bin/python3.7 /usr/bin/python
ln -s /usr/local/python3/bin/pip3 /usr/bin/pip3
python3:error while loading shared libraries:libpython3.7m.so.1.0:cannot open shared object file
cd /etc/ld.so.conf.d
vi python3.conf
/usr/local/python3/lib
ldconfig
原文:https://www.cnblogs.com/jmtang/p/12781486.html