Redhat从源安装Python2.7.12
来源:互联网 发布:工作流程如何优化 编辑:程序博客网 时间:2024/05/17 07:10
有些时候,由于操作系统的不完整,我们无法直接安装binary的Python,而需要从Python源代码进行编译和安装。
以Redhat系统从源安装Python2.7.12为例。
# Step 1, Install compilers and related toolsyum groupinstall -y "development tools"# Step 2, Install libraries needed to compile all features of Pythonyum install -y zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel expat-devel# Step 3, Download python 2.7.12wget http://python.org/ftp/python/2.7.12/Python-2.7.12.tar.xz# Step 4, Decompress the downloaded filetar xf Python-2.7.12.tar.xzcd Python-2.7.12# Step 5, Configure python 2.7.12 source code./configure --prefix=/usr/local --enable-unicode=ucs4 --enable-shared LDFLAGS="-Wl,-rpath /usr/local/lib"# Step 6, Install python 2.7.12make && make altinstall# Step 7, Set python 2.7.12 as default pythonsudo rm -rf /usr/bin/pythonln -s /usr/local/bin/python2.7 /usr/bin/python# Step 8, Download pip install scriptwget --no-check-certificate https://bootstrap.pypa.io/get-pip.py# Step 9, Install pippython get-pip.py --index-url=http://pypi.python.org/simple/ --trusted-host pypi.python.org# Step 10, Make Sure yum configuration is NOT changedsed '1d' /usr/bin/yum > tmpfile; sed -i '1 i\#!/usr/bin/python2.6' tmpfile; mv tmpfile /usr/bin/yum; sudo chmod 755 /usr/bin/yum
在第6步中,有可能出现make
(等同于make all
)命令无线循环的问题。这时,可以参考这个网页:https://stackoverflow.com/questions/11179203/python-build-goes-into-infinite-loop。例如,使用date
命令,将系统时间修改成当前时间:
date +%Y%m%d -s "20170809"
阅读全文
0 0
- Redhat从源安装Python2.7.12
- redhat 5.5 安装python2.7
- Redhat环境安装MySQLdb——python2
- 从硬盘安装Redhat
- 【RedHat】手动编译安装Python3、Python2 pip 及pip安装dpkt、scapy、pcap
- python2.7.12安装MySQLdb模块
- centos6.5安装python2.7.12
- centos6.5 安装python2.7.12
- 03-redhat-6.5升级python2.6到python2.7&安装psycopg2&连接postgresql-9.6.1(201-02-07)
- django-python2.7下的django,从安装到访问
- Redhat 中安装centosYUM 源
- centos/redhat安装yum源
- [转]从硬盘安装 RedHat Enterprise Linux Server 5 iso
- Centos7.3安装python2.7.12+ipython1.2.1
- 从python2到python3
- redhat 默认python2.6 升级到2.7
- win10,64bit安装Python2.7.12及一些安装包
- redhat 6 使用centos源 yum安装
- 设计原则
- POJ 3549 Flow Problem
- 学习JS你得走的路有哪些?
- 关于CheckBox反复调用attr("checked", false)不好使情况
- FCC——Convert HTML Entities
- Redhat从源安装Python2.7.12
- Communications link failure:The last packet sent successfully to the server was 0 milliseconds ago.
- CentOS修改MySQL的root密码
- TextView设置背景图片为.9.png文字不显示
- Microsoft Mixed Reality 环境搭建心得
- H5---面试题三
- POJ 2777 Count Color——区间更新的线段树+状态压缩
- CSDN写博客时如何预览
- 初识Python-python教程总结