Linux 源码编译Python 3.6

1.操作系统以及版本显示

# uname -sr
Linux 3.10.0-514.el7.x86_64
# uname -sr
Linux 3.10.0-514.el7.x86_64

2.下载Python安装包

# wget https://www.python.org/ftp/python/3.6.1/Python-3.6.1.tar.xz

3.开始进行编译安装python
  3.1 解压python

# tar -xf Python-3.6.1.tar.xz



  3.2 获取帮助

# cd Python-3.6.1/
# cat README.rst

3.3 查看编译的参数

# ./configure --help


  3.4 开始编译

# yum install -y gcc gcc-c++
# ./configure --prefix=/usr/local/python-3.6
# make && make install


  3.5 测试

[root@localhost Python-3.6.1]# /usr/local/python-3.6/bin/python3.6
Python 3.6.1 (default, May 10 2017, 08:59:54)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>


4.出现的错误以及解决办法
在进行make install 的时候出现了以下信息,安装被终止

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


解决办法:

相关推荐