Python3.6安装

安装依赖

1
# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel gcc gcc-c++ -y

下载介质

Donwload

解压安装包

1
# tar -xzvf Python-3.6.5.tgz

启动ssl模块(setup.dist)

1
2
3
4
5
6
7
8
9
# Socket module helper for socket(2)
_socket socketmodule.c timemodule.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/ssl
_ssl _ssl.c \
-DUSE_SSL -I$(SSL)/include -I$(SSL)/include/openssl \
-L$(SSL)/lib -lssl -lcrypto

编译安装

1
2
# ./configure --with-ssl --prefix=/usr/local/python3.6
# make && make install -j 4

建立软连接

1
2
# ln -s /usr/local/python3.6/bin/python /usr/bin/python3
# ln -s /usr/local/python3.6/bin/pip3 /usr/bin/pip3

查看python版本

1
# python3 -V
Licensed under CC BY-NC-SA 4.0
comments powered by Disqus