zoukankan      html  css  js  c++  java
  • Redhat 安装编译 Python-2.7.12

    Redhat 安装编译 Python-2.7.12

     

    下载并安装Python-2.7.12.tgz

    1. tar xvf Python-2.7.12.tgz
    2. cd Python-2.7.12
    3. ./configure -–shared-static
    4. make
    5. sudo Make install

    问题:

    1. /usr/local/bin/python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory

    http://blog.csdn.net/wanyanxgf/article/details/8021641

    解决方法如下

    1.编辑      vi /etc/ld.so.conf 

    如果是非root权限帐号登录,使用 sudo vi /etc/ld.so.conf 

    添加上python2.7lib库地址,如我的/usr/local/Python2.7/lib,保存文件

     

    2.执行 /sbin/ldconfig -v命令,如果是非root权限帐号登录,使用 sudo  /sbin/ldconfig -v。这样 ldd 才能找到这个库,执行python2.7就不会报错了

    问题:

    [root@develop bin]# yum  

    [root@develop local]# yum -y install prce  

    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.6.1 (r261:67515, Aug 7 2010, 11:36:17)  

    [GCC 4.1.2 20080704 (Red Hat 4.1.2-44)]  

        

        

    If you cannot solve this problem yourself, please go to  

    the yum faq at:  

    http://wiki.linux.duke.edu/YumFaq  

    解决:

    http://blog.csdn.net/ei__nino/article/details/8495295

    查看python版本

    1. whereis python 
    2. python –version
    3. [root@develop local]# which yum  
    4. /usr/bin/yum  
    5. [root@develop local]# vi /usr/bin/yum  

    #!/usr/local/bin/python

    改为:#!/usr/bin/python2.6

    新装的python都不管用,用whereis python命令找到了原有的python2.6

    Yum成功修复。

  • 相关阅读:
    matplotlib 学习总结
    数据获取,解析,存储等知识的学习总结
    python学习总结
    Mybatis Plus各种查询方法
    centos启动Nginx提示nginx: [emerg] still could not bind()
    vue只能本地跨域,线上跨域要后端弄
    小程序图片懒加载
    html直接引入vue.js
    vue监听浏览器关闭
    【算法】归并排序算法的编码和优化
  • 原文地址:https://www.cnblogs.com/yizhichun/p/6339749.html
Copyright © 2011-2022 走看看