linux python 安装失败,Linux下面安装Python常见错误解决方法

1、升级Python导致yum无法使用,报错No module named yum Please install a package which provides this module, or。。。。

解决方式

# vi /usr/bin/yum

#!/usr/bin/python2.6    改成老版本的python

2、安装setuptools报错Compression requires the (missing) zlib module。。。。。。

这种错误是由于安装Python的时候没有进行依赖包的检查,重新安装

安装zlib

$wget http://zlib.net/zlib-1.2.8.tar.gz$tar -xvzf zlib-1.2.8.tar.gz$cd zlib-1.2.8.tar.gz$./configure$make$sudo make install

然后再次安装Python

cd Python-2.7.12

./configure --prefix=/usr/local/python2.7.12

make && make install

再次安装setuptools,不再报错,如下所示

copying setuptools.egg-info/entry_points.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying setuptools.egg-info/requires.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

copying setuptools.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO

creating 'dist/setuptools-1.4.2-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it

removing 'build/bdist.linux-x86_64/egg' (and everything under it)

Processing setuptools-1.4.2-py2.7.egg

Copying setuptools-1.4.2-py2.7.egg to /usr/local/python2.7.12/lib/python2.7/site-packages

Adding setuptools 1.4.2 to easy-install.pth file

Installing easy_install script to /usr/local/python2.7.12/bin

Installing easy_install-2.7 script to /usr/local/python2.7.12/bin

Installed /usr/local/python2.7.12/lib/python2.7/site-packages/setuptools-1.4.2-py2.7.egg

Processing dependencies for setuptools==1.4.2

Finished processing dependencies for setuptools==1.4.2

[root@bogon setuptools-1.4.2]#

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值