这期内容当中小编将会给大家带来有关Centos6 中怎么安装Python 3,文章内容丰富且以专业的角度为大家分析和叙述,阅读完这篇文章希望大家可以有所收获。
Install Required Packages #sudo yum install gcc openssl-devel bzip2-devel libffi-devel
Download Python 3.8#wget https://www.python.org/ftp/python/3.8.5/Python-3.8.5.tgz#tar xzf Python-3.8.5.tgz
Compilecd Python-3.8.5./configure --with-openssl=/usr/local/openssl
default: /usr/localmake && make altinstallmake altinstall is used to prevent replacing the default python binary file /usr/bin/python. Can not connect to HTTPS URL because the SSL module is not available to solve the problemwget http://www.openssl.org/source/openssl-1.0.2t.tar.gzDecompress, compile and install:tar zxvf openssl 1.0 2j. tar .gzcd openssl-1.0.2j./config --prefix=/usr/local/openssl shared zlibmake && make installAfter modifications are complete, we need to create two points soft link dynamic link library file:ln -s /usr/local/openssl/lib/libssl.so.1.0.0 /usr/lib64/libssl.so.1.0.0ln -s /usr/local/openssl/lib/libcrypto.so.1.0.0 /usr/lib64/libcrypto.so.1.0.0
vi Modules/Setup

Socket module helper for socket(2)

#_socket socketmodule.c

Socket module helper for SSL support; you must comment out the other

socket line above, and possibly edit the SSL variable:

SSL = / usr / local / Lab / openssl- 1.0 .2j / # uncomment this line, and the original / usr / local / ssl changed our newly installed openssl directory: / usr / local / lab / openssl- 1.0 .2j / _ssl _ssl.c \ # Uncomment this line The -I $ -DUSE_SSL (SSL) / the include the -I $ (SSL) / the include / OpenSSL \ # Uncomment this line -L $ (SSL) / lib -lssl - lcrypto # Uncomment this line

The crypt module is now disabled by default because it breaks builds

on many systems (where -lcrypt is needed), e.g. Linux (I believe).

#_crypt _cryptmodule.c # -lcrypt # crypt(3); needs -lcrypt on some systems