First, upgrade dependent packages
yum -y install wget gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel libffi-devel
Second, compile and install
1, extract the installation files, into the directory, the path of the compiler arranged: ./ configure --prefix = / opt / python / python-3.8.1
2, optimization options: ./ configure --enable-optimizations
3. Compile: make
Compile and install make install
报错:could not import runpy module
---->
Try: https://blog.csdn.net/whatday/article/details/103903955
./configure --enable-optimizations 去掉--enable-optimizations
unsuccessful
--->
Try to upgrade gcc
Centos7 gcc version default 4.8.3, Red Hat in order to stabilize and support the software version, the version is 4.8.3 yum, yum can not be used for software updates, so use scl. Remember networking.
https://www.cnblogs.com/dj0325/p/8481092.html
yum install centos-release-scl scl-utils-build
yum list all --enablerepo='centos-sclo-rh'
Comrades, our predecessors said is right, do not lift the GCC, as well as bigger pit. / Configure unsuccessful reason is the file you want to delete all before, I also thought suddenly shot forehead, then delete all the files re-extract, then ./configure, then make && make install
Finally OK.