嵌入式之家

 找回密码
 现在注册

QQ登录

只需一步,快速开始

搜索
热搜: ARM cortex
查看: 4716|回复: 0

python: error while loading shared libraries: libpython2.7.so.1.0: cannot ...

[复制链接]
  • TA的每日心情
    开心
    2020-6-18 22:00
  • 签到天数: 1 天

    [LV.1]初来乍到

    101

    主题

    192

    帖子

    1645

    积分

    管理员

    Rank: 9Rank: 9Rank: 9

    积分
    1645
    发表于 2016-7-26 15:12:27 | 显示全部楼层 |阅读模式
    问题描述:
    python升级到2.7.12后执行python -V错误
    1. [root[url=home.php?mod=space&uid=8]@helloworld[/url] lib]# python -V
    2. python: error while loading shared libraries: libpython2.7.so.1.0: cannot open shared object file: No such file or directory
    复制代码


    解决方法:
    1、查看有没有库文件,libpython2.7.so.1.0

    1. [root@helloworld python-build-2.7.12]# whereis libpython2.7.so.1.0
    2. libpython2.7.so.1: /usr/local/lib/libpython2.7.so.1.0
    复制代码



    2、如果whereis输出结果像上面那样:
    在/etc/ld.so.conf中加入新行
    1. /usr/local/lib
    复制代码


    保存后,运行
    1. /sbin/ldconfig
    2. /sbin/ldconfig –v
    复制代码


    3、如果whereis没有输出,执行:
    1. cp /usr/local/python27/lib/libpython2.7.so.1.0 /usr/local/lib
    2. cd /usr/local/lib
    3. ln -s libpython2.7.so.1.0 libpython2.7.so
    复制代码


    python -V如果继续出现错误信息,那么请执行第2步。

    回复

    使用道具 举报

    您需要登录后才可以回帖 登录 | 现在注册

    本版积分规则

    QQ|Archiver|手机版|小黑屋|嵌入式之家 ( 京ICP备14038168号-1 )

    GMT+8, 2024-5-21 05:40 , Processed in 0.022268 second(s), 30 queries .

    Powered by Discuz! X3.4

    Copyright © 2001-2020, Tencent Cloud.

    快速回复 返回顶部 返回列表