TA的每日心情 | 开心 2020-6-18 22:00 |
---|
签到天数: 1 天 [LV.1]初来乍到
管理员
  
- 积分
- 1645
|
问题描述:
python升级到2.7.12后执行python -V错误
- [root[url=home.php?mod=space&uid=8]@helloworld[/url] lib]# python -V
- 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
- [root@helloworld python-build-2.7.12]# whereis libpython2.7.so.1.0
- libpython2.7.so.1: /usr/local/lib/libpython2.7.so.1.0
复制代码
2、如果whereis输出结果像上面那样:
在/etc/ld.so.conf中加入新行
保存后,运行
- /sbin/ldconfig
- /sbin/ldconfig –v
复制代码
3、如果whereis没有输出,执行:
- cp /usr/local/python27/lib/libpython2.7.so.1.0 /usr/local/lib
- cd /usr/local/lib
- ln -s libpython2.7.so.1.0 libpython2.7.so
复制代码
python -V如果继续出现错误信息,那么请执行第2步。
|
|