#zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz 

Modules/Setup.dist

https://askubuntu.com/questions/661039/trouble-with-zip-support-in-custom-python-build-zipimport-zipimporterror-cant

yum -y install gcc gcc-c++ zlib*;

wget https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tgz;
tar -xvf Python-3.6.5.tgz;cd Python-3.6.5;./configure;make;make install;

wget --no-check-certificate https://files.pythonhosted.org/packages/source/p/pip/pip-10.0.0.tar.gz;
tar -xvf pip-10.0.0.tar.gz;
cd pip-10.0.0;python3 setup.py build;python3 setup.py install;

python3 pip3

RHEL 8 install Python 3 or Python 2 using yum

https://www.cyberciti.biz/faq/rhel-8-install-python-3-or-python-2-using-yum/

How to find out Python package names on RHEL 8

Try any one of the following syntax along with grep command:
sudo yum search python3 | more
sudo yum search python2 | more
sudo yum search python36
sudo yum search python2 | grep 'python2.x86_64'

You can show detailed information before installing package as well:
sudo yum info python2.x86_6
sudo yum info python36

http://ask.xmodulo.com/install-python3-centos.html

Method One: Build and Install Python3 from the Source

You can always build python3 from its source manually. Since you can choose the version of python3 to install, this is the surest way to meet Python dependency requirement.

Here is how you can build and install python3 from the source.

First, install minimum necessary tools:

$ sudo yum install yum-utils

Then using yum-builddep, set up a necessary build environment for python3 and install missing dependencies. The following command will automatically take care of that.

$ sudo yum-builddep python

Now download the latest python3 (e.g., python 3.5) from https://www.python.org/ftp/python/

$ curl -O https://www.python.org/ftp/python/3.5.0/Python-3.5.0.tgz

Finally, build and install python3 as follows. The default installation directory is /usr/local. If you want to change this to some other directory, pass "--prefix=/alternative/path" parameter to configure before running make.

$ tar xf Python-3.5.0.tgz
$ cd Python-3.5.0
$ ./configure
$ make
$ sudo make install

This will install python3pip3setuptools as well as python3 libraries on your CentOS system.

Method Two: Install Python3 from EPEL Repository

The latest EPEL 7 repository offers python3 (python 3.4 to be exact). Thus if you are using CentOS 7 or later, you can easily install python3 by enabling EPEL repository as follows.

$ sudo yum install epel-release

Then install python 3.4 and its libraries using yum:

$ sudo yum install python34

Note that this will not install matching pip. To install pip and setuptools, you need to install them separately as follows.

$ curl -O https://bootstrap.pypa.io/get-pip.py
$ sudo /usr/bin/python3.4 get-pip.py

检查修改 软连接
[xiaole@localhost bin]$ ll -as | grep python
12 -rwxr-xr-x. 1 root root 11232 12月 2 2016 abrt-action-analyze-python
0 lrwxrwxrwx. 1 root root 7 7月 27 11:34 python -> python2
0 lrwxrwxrwx. 1 root root 9 7月 27 11:34 python2 -> python2.7
8 -rwxr-xr-x. 1 root root 7216 6月 21 04:28 python2.7
0 lrwxrwxrwx. 1 root root 9 7月 27 11:37 python3 -> python3.6
0 lrwxrwxrwx. 1 root root 18 7月 27 11:37 python36 -> /usr/bin/python3.6
12 -rwxr-xr-x. 2 root root 11408 4月 26 05:05 python3.6
12 -rwxr-xr-x. 2 root root 11408 4月 26 05:05 python3.6m

[xiaole@localhost bin]$ sudo rm python
[xiaole@localhost bin]$ sudo ln -s python python36
ln: 无法创建符号链接"python36": 文件已存在
[xiaole@localhost bin]$ ll -as | grep python
12 -rwxr-xr-x. 1 root root 11232 12月 2 2016 abrt-action-analyze-python
0 lrwxrwxrwx. 1 root root 9 7月 27 11:34 python2 -> python2.7
8 -rwxr-xr-x. 1 root root 7216 6月 21 04:28 python2.7
0 lrwxrwxrwx. 1 root root 9 7月 27 11:37 python3 -> python3.6
0 lrwxrwxrwx. 1 root root 18 7月 27 11:37 python36 -> /usr/bin/python3.6
12 -rwxr-xr-x. 2 root root 11408 4月 26 05:05 python3.6
12 -rwxr-xr-x. 2 root root 11408 4月 26 05:05 python3.6m
[xiaole@localhost bin]$ ln -s python python3.6
ln: 无法创建符号链接"python3.6": 文件已存在
[xiaole@localhost bin]$ ln -s python3.6 python
ln: 无法创建符号链接"python": 权限不够
[xiaole@localhost bin]$ sudo ln -s python3.6 python
[xiaole@localhost bin]$ python
Python 3.6.8 (default, Apr 25 2019, 21:02:35)

[xiaole@localhost autocloudservices]$ sudo yum -y install gcc gcc-c++ zlib*;
[sudo] password for xiaole:
File "/bin/yum", line 30
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax
[xiaole@localhost autocloudservices]$ which yum
/usr/bin/yum
[xiaole@localhost autocloudservices]$ sudo /usr/bin/yum
File "/usr/bin/yum", line 30
except KeyboardInterrupt, e:
^
SyntaxError: invalid syntax
[xiaole@localhost autocloudservices]$ sudo vim /usr/bin/yum
[xiaole@localhost autocloudservices]$

Centos7 安装python3详细教程,解决升级后不兼容问题

https://www.jianshu.com/p/a538125371d4

运行yum安装其他软件可能出现以下错误,这也是因为Python版本问题,
vi /usr/libexec/urlgrabber-ext-down 修改第一行的Python为重命名的名字(指向python2.7的)

保留python2.7 修改安装过程python报错的python文件
#! /usr/bin/python --->
#! /usr/bin/python2.7

编译安装3.7.4

sudo yum install libffi-devel

which python
/usr/bin/python

cd /user/
sudo
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
tar -xvf Python-3.7.4.tar.xz
cd Python-3.7.4.tar.xz
./configure
make
make install
sudo ln -s /usr/Python-3.7.4/python /usr/bin/python374
which python374
/usr/bin/python374

关于在centos下安装python3.7.0以上版本时报错ModuleNotFoundError: No module named '_ctypes'的解决办法
3.7版本需要一个新的包libffi-devel,安装此包之后再次进行编译安装即可。

#yum install libffi-devel -y
#make install
若在安装前移除了/usr/bin下python的文件链接依赖,此时yum无法正常使用,需要自己下载相关软件包安装,为节省读者时间,放上链接

#wget http://mirror.centos.org/centos/7/os/x86_64/Packages/libffi-devel-3.0.13-18.el7.x86_64.rpm
#rpm -ivh libffi-devel-3.0.13-18.el7.x86_64.rpm
————————————————
原文链接:https://blog.csdn.net/qq_36416904/article/details/79316972

删除原python
sudo rm -rf /usr/bin/python

新建软连接到另一个软连接
sudo ln -s /usr/bin/python374 /usr/bin/python

注意 库文件的重新安装

Could not install packages due to an EnvironmentError: [Errno 13] 权限不够: '/usr/local/lib/python3.7/site-packages/six.py'
pip3 install -r requirements.txt

https://docs.python.org/3.7/whatsnew/3.7.html

ssl

The ssl module now uses OpenSSL’s builtin API instead of match_hostname() to check a host name or an IP address. Values are validated during TLS handshake. Any certificate validation error including failing the host name check now raises SSLCertVerificationError and aborts the handshake with a proper TLS Alert message. The new exception contains additional information. Host name validation can be customized with SSLContext.hostname_checks_common_name. (Contributed by Christian Heimes in bpo-31399.)

Note

The improved host name check requires a libssl implementation compatible with OpenSSL 1.0.2 or 1.1. Consequently, OpenSSL 0.9.8 and 1.0.1 are no longer supported (see Platform Support Removals for more details). The ssl module is mostly compatible with LibreSSL 2.7.2 and newer.

The ssl module no longer sends IP addresses in SNI TLS extension. (Contributed by Christian Heimes in bpo-32185.)

match_hostname() no longer supports partial wildcards like www*.example.org. (Contributed by Mandeep Singh in bpo-23033 and Christian Heimes in bpo-31399.)

The default cipher suite selection of the ssl module now uses a blacklist approach rather than a hard-coded whitelist. Python no longer re-enables ciphers that have been blocked by OpenSSL security updates. Default cipher suite selection can be configured at compile time. (Contributed by Christian Heimes in bpo-31429.)

Validation of server certificates containing internationalized domain names (IDNs) is now supported. As part of this change, the SSLSocket.server_hostname attribute now stores the expected hostname in A-label form ("xn--pythn-mua.org"), rather than the U-label form ("pythön.org"). (Contributed by Nathaniel J. Smith and Christian Heimes in bpo-28414.)

The ssl module has preliminary and experimental support for TLS 1.3 and OpenSSL 1.1.1. At the time of Python 3.7.0 release, OpenSSL 1.1.1 is still under development and TLS 1.3 hasn’t been finalized yet. The TLS 1.3 handshake and protocol behaves slightly differently than TLS 1.2 and earlier, see TLS 1.3. (Contributed by Christian Heimes in bpo-32947bpo-20995bpo-29136bpo-30622 and bpo-33618)

SSLSocket and SSLObject no longer have a public constructor. Direct instantiation was never a documented and supported feature. Instances must be created with SSLContext methods wrap_socket() and wrap_bio(). (Contributed by Christian Heimes in bpo-32951)

OpenSSL 1.1 APIs for setting the minimum and maximum TLS protocol version are available as SSLContext.minimum_version and SSLContext.maximum_version. Supported protocols are indicated by several new flags, such as HAS_TLSv1_1. (Contributed by Christian Heimes in bpo-32609.)

Added SSLContext.post_handshake_auth to enable and ssl.SSLSocket.verify_client_post_handshake() to initiate TLS 1.3 post-handshake authentication. (Contributed by Christian Heimes in bpo-34670.)

从下载新版OpenSsh
https://www.openssl.org/source/

wget https://www.openssl.org/source/openssl-1.1.1d.tar.gz

ln -s /usr/local/lib64/libssl.so.1.1 /usr/lib64/libssl.so.1.1
ln -s /usr/local/lib64/libcrypto.so.1.1 /usr/lib64/libcrypto.so.1.1

ln -sf /usr/local/bin/openssl /usr/bin/openssl

检查openssh版本
openssh version
[xiaole@test-proxy-2 root]$ /usr/local/bin/openssl version
OpenSSL 1.1.1d 10 Sep 2019
[xiaole@test-proxy-2 root]$

Python编译安装
--with-openssl=DIR root of the OpenSSL directory
--with-ssl-default-suites=[python|openssl|STRING]
Override default cipher suites string, python: use
Python's preferred selection (default), openssl:
leave OpenSSL's defaults untouched, STRING: use a
custom string, PROTOCOL_SSLv2 ignores the setting
Some influential environment variables:
MACHDEP name for machine-dependent library files
CC C compiler command
CFLAGS C compiler flags
LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a
nonstandard directory <lib dir>
LIBS libraries to pass to the linker, e.g. -l<library>
CPPFLAGS (Objective) C/C++ preprocessor flags, e.g. -I<include dir> if
you have headers in a nonstandard directory <include dir>
CPP C preprocessor
PKG_CONFIG path to pkg-config utility
PKG_CONFIG_PATH
directories to add to pkg-config's search path
PKG_CONFIG_LIBDIR
path overriding pkg-config's built-in search path

Use these variables to override the choices made by `configure' or to help
it to find libraries and programs with nonstandard names/locations.

Report bugs to <https://bugs.python.org/>.

xiaole@test-proxy-2 Python-3.7.4]$ python3.7
Python 3.7.4 (default, Sep 23 2019, 17:24:04)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-23)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>> import _ssl
>>>

zipimport.ZipImportError: can’t decompress data; zlib not available

缺少了zlib的解压缩类库,安装即可

yum -y install zlib*

python3 安装 #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz RHEL 8 install Python 3 or Python 2 using yum 编译安装 python3.7.4 . OpenSSL 1.0.2 or 1.1. Consequently, OpenSSL 0.9.8 and 1.0的更多相关文章

  1. python3 安装 #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz

    #zlib zlibmodule.c -I$(prefix)/include -L$(exec_prefix)/lib -lz Modules/Setup.dist https://askubuntu ...

  2. yum && 编译 安装mysql 5.7 多实例

    yum安装 [root@localhost ~]# wget http://repo.mysql.com/mysql57-community-release-el7.rpm [root@localho ...

  3. (转)RHEL/CentOS 6.x使用EPEL6与remi的yum源安装MySQL 5.5.x

    PS:如果既想获得 RHEL 的高质量.高性能.高可靠性,又需要方便易用(关键是免费)的软件包更新功能,那么 Fedora Project 推出的 EPEL(Extra Packages for En ...

  4. RHEL/CentOS 6.x使用EPEL6与remi的yum源安装MySQL 5.5.x

    PS:如果既想获得 RHEL 的高质量.高性能.高可靠性,又需要方便易用(关键是免费)的软件包更新功能,那么 FedoraProject 推出的 EPEL(Extra Packages for Ent ...

  5. Yum编译安装Error Downloading Packages报错

    1:执行yum clean all 清除缓存目录下的软件包及旧的headers: 2:接着执行 yum list重新列出所有已经安装和可以安装的软件包: 3:重新执行上述命令,发现yum编译成功: 注 ...

  6. Python3编译安装以及创建虚拟运行环境

    一.yum安装pip# yum -y install epel-release   #Centos6.8安装epel源# yum -y install python-pip手动安装pip# wget ...

  7. centos7编译安装LNMP(nginx-1.16.0,mysql8.0.16,php-7.3.6)常见问题报错及解决方法

    LNMP的安装与配置 nginx-1.16.0安装及配置: 第一步:前往官网下载nignx源码包 下载完毕后上传至服务器(先安装lrzsz) yum -y install lrzsz 安装完毕后执行: ...

  8. CentOS7下编译安装Python3.7.x【亲测有效】

    所有操作都在root用户下操作 下载安装包 编译安装 建立软链接 验证 安装: 更新yum: yum update 安装Python依赖: yum install openssl-devel bzip ...

  9. Linux下编译安装源码包软件 configure ,make, make install, make test/check, make clean

    http://www.360doc7.net/wxarticlenew/541275971.html 一.什么是源码包软件? 顾名思义,源码包就是源代码的可见的软件包,基于Linux和BSD系统的软件 ...

随机推荐

  1. Tomcat服务器的下载以及配置

    1,Tomcat的下载与安装 本人采用的是解压版安装,只需要在官网(https://tomcat.apache.org/)下载好压缩版的Tomcat,再解压在你想安装的目录下即可.我的安装目录是D:\ ...

  2. Android硬件访问服务中的HAL-查看打印的信息

    JNI  向上提供本地函数,向下加载HAL文件并调用HAL的函数 HAL 负责访问驱动程序执行硬件操作. external\chromium_org\third_party\hwcplus\src\h ...

  3. java Stream学习笔记

    1.Stream与io无关. 2.Stream和用普通的循环没有太大区别,甚至时间复杂度更高,代码可读性差(通常代码行数更少). 3.流操作就是把循环要做的任务单独抽取出来,最终通过编译在一起. 来看 ...

  4. java Swing组件随着窗口拖动等比移动或等比放大

    实现原理很简单, 1清空布局(使用绝对布局) 2添加监听器(监听窗口是否被拖动) 3在监听器里面动态调整 组件的位置 效果如下: 拖动之后效果: 代码实现: import java.awt.Event ...

  5. 容器编排系统K8s之Pod Affinity

    前文我们了解了k8s上的NetworkPolicy资源的使用和工作逻辑,回顾请参考:https://www.cnblogs.com/qiuhom-1874/p/14227660.html:今天我们来聊 ...

  6. ABP vNext 审计日志获取真实客户端IP

    背景 在使用ABP vNext时,当需要记录审计日志时,我们按照https://docs.abp.io/zh-Hans/abp/latest/Audit-Logging配置即可开箱即用,然而在实际生产 ...

  7. #3使用html+css+js制作网页 制作登录网页

    #3使用html+css+js制作网页 制作登录网页 本系列链接 2制作登录网页 2.1 准备 2.1.1 创建文件夹 2.1.2 创建主文件 2.2 html部分 2.2.1 网站信息 2.2.2 ...

  8. C语言实现九大排序算法

    C语言实现九大排序算法 直接插入排序 折半插入排序 希尔排序 冒泡排序 快速排序 直接选择排序 堆排序 归并排序 基数排序 C语言实现九大排序算法 直接插入排序 将数组分为两个部分,一个是有序部分,一 ...

  9. .NET 云原生架构师训练营(模块二 基础巩固 RabbitMQ Masstransit 异常处理)--学习笔记

    2.6.8 RabbitMQ -- Masstransit 异常处理 异常处理 其他 高级功能 异常处理 异常与重试 重试配置 重试条件 重新投递信息 信箱 异常与重试 Exception publi ...

  10. 【Linux】postfix大坑笔记

    由于需要,想弄一个自动发送邮件的mailx或者sendmail 但是执行 echo "test" | mail -s "Worning mail !" xxxx ...