在官网可以获得Python的安装介质:
https://www.python.org/downloads/release/python-2713/
https://www.python.org/downloads/release/python-360/

如果你下载的是【tgz】的软件包,你需要按照下面的步骤执行安装:

1. 安装需要的软件包:
yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel gcc

2. 解压:tar xf xxx.tgz

3. 进入解压后的目录,开始编译:
./configure –prefix=/usr/local/ –enable-shared
make

4. 安装:
make install

5. 配置ldconfig

6. 应用ldconfig

注意,如果没有上面ldconfig的配置,那么你在调用python的时候,会遇到错误:

7. 上述步骤完成后,就可以使用python了:

————————————————
Done。

1 thought on “Install Python,二进制编译”

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.

隐藏
变装