1.操作系统以及版本显示
# uname -srLinux 3.10.0-514.el7.x86_64
# uname -srLinux 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
# cd Python-3.6.1/# cat README.rst
3.3 查看编译的参数
# ./configure --help
# yum install -y gcc gcc-c++# ./configure --prefix=/usr/local/python-3.6# make && make install
[root@localhost Python-3.6.1]# /usr/local/python-3.6/bin/python3.6Python 3.6.1 (default, May 10 2017, 08:59:54)[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linuxType "help", "copyright", "credits" or "license" for more information.>>>
zipimport.ZipImportError: can't decompress data; zlib not available
# yum install -y zlib zlib-devel
2017-05-10 09:24:12 公司宿舍