安装 python2.7.8
来源:互联网 发布:python rsa 私钥加密 编辑:程序博客网 时间:2024/06/05 00:29
1 下载2.7.8.tgz包
https://www.python.org/downloads/
https://www.python.org/downloads/release/python-278/
2 在linux的admin用户目录下解压
解压缩Python-2.7.8.tgz进入Python-2.7.8目录
tar -zxvf Python-2.7.8.tgz
3 进入Python-2.7.8目录
sudo ./configure --prefix=/usr/bin/Python2.7 --enable-shared
sudo makesudo make install4 进入到 /usr/bin/Python2.7/bin 目录,执行python2.7,报错
[shuohai.lhl@XXX /usr/bin/Python2.7/bin]$ ll 48-rwxr-xr-x 1 root root 18555 05-31 10:56 smtpd.py-rwxr-xr-x 1 root root 92 05-31 10:56 pydoc-rwxr-xr-x 1 root root 107 05-31 10:56 idle-rwxr-xr-x 1 root root 109 05-31 10:56 2to3-rwxr-xr-x 1 root root 10150 05-31 10:56 python2.7lrwxrwxrwx 1 root root 14 05-31 10:56 python-config -> python2-configlrwxrwxrwx 1 root root 16 05-31 10:56 python2-config -> python2.7-config-rwxr-xr-x 1 root root 1682 05-31 10:56 python2.7-configlrwxrwxrwx 1 root root 9 05-31 10:56 python2 -> python2.7lrwxrwxrwx 1 root root 7 05-31 10:56 python -> python2[shuohai.lhl@XXX /usr/bin/Python2.7/bin]$ ./python2.7./python2.7: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
报这个错误
./python2.7: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
解决办法:
编辑文件 sudo vi /etc/ld.so.conf,添加一行
/usr/bin/Python2.7/lib然后执行
sudo /sbin/ldconfigsudo /sbin/ldconfig -v5 修改后,在 /usr/bin/Python2.7/bin 目录,执行python2.7,显示python控制台
[shuohai.lhl@v101108034 /usr/bin/Python2.7/bin]$ ./python2.7Python 2.7.8 (default, May 31 2015, 10:55:21) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>>
6 修改用户目录的.bashrc文件,把python执行路径加入到环境变量中
export PATH="/usr/bin/Python2.7/bin:$PATH"7 退出然后登陆sudo su admin,直接执行 python2.7,提示进入pyrhon2.7.8控制台
[admin@xxxxxx ~]$ python2.7Python 2.7.8 (default, May 31 2015, 10:55:21) [GCC 4.1.2 20080704 (Red Hat 4.1.2-51)] on linux2Type "help", "copyright", "credits" or "license" for more information.>>>
0 0
- Centos python2.7.8 安装
- 安装 python2.7.8
- Centos 6 安装python2.7.8
- centos6.5 源代码方式安装python2.7.8
- Linux下python2.7.8的安装
- python2.5.2安装问题解决
- python2.7.2的安装
- CentOS安装python2.6
- python2.7.2的安装
- Python2.7绿色安装
- 安装python2.7.3
- centos安装python2.7
- centos 安装python2.7
- python2.7.1安装详解
- python2.7.2的安装
- 安装python2.5
- linux 安装 python2.7
- CentOS6 安装 Python2.7
- 【PS后期】PS合成中如何协调不同素材颜色
- TextView图文混排,显示添加的图片,三种常用方法,亲测
- 2015.5.31 第二周状态
- [数学学习2]映射
- Android中的ListView使用案例(SimpleAdapter实现)
- 安装 python2.7.8
- Queue::定义
- 【ci框架】config.php配置文件解读
- CSDN博客主页面设置
- ci框架理解流程
- 你没有变强,是因为你一直很舒服
- JNI知识总结
- 环信im集成
- 华为2014机试样题2:求最大递增数