zoukankan      html  css  js  c++  java
  • Centos6.5 python升级成2.7版本出现的一些问题解决方法

    由于功能及程序依赖,需要将Centos上的python从2.6升级成2.7,把碰到的一些问题记录如下:

    安装好2.7后将原来的/usr/bin/python改成/usr/bin/python26,并将2.7的bin目录加入执行路径

    Question1: 执行yum报No module named yum

    [root@zejin240 ~]# yum list
    There was a problem importing one of the Python modules
    required to run yum. The error leading to this problem was:
    
       No module named yum
    
    Please install a package which provides this module, or
    verify that the module is installed correctly.
    
    It's possible that the above module doesn't match the
    current version of Python, which is:
    2.7.12 (default, Jul  6 2016, 18:40:00) 
    [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]
    
    If you cannot solve this problem yourself, please go to 
    the yum faq at:
      http://yum.baseurl.org/wiki/Faq

    解决方法:

    vi /usr/binyum

    #!/usr/bin/python26

    Question2: 执行pip时提示  ImportError: No module named pip

    解决方法:python -m  ensurepip

    Questions3:源码安装paramiko出现各种模块找不到

    解决方法:

    pip install -I pycrypto
    pip install -I paramiko
  • 相关阅读:
    连通域标记
    qt&gdal
    gdal vs2013编译
    java配置
    windows下面安装Python和pip
    mfc operator new”: 没有重载函数接受 3 个参数
    std::min&std::max与mfc冲突问题
    qt中vtk易出现错误
    cmake构建qt工程
    Webstorm补丁
  • 原文地址:https://www.cnblogs.com/zejin2008/p/5651133.html
Copyright © 2011-2022 走看看