Import Error: cannot open shared object file: No such file or directory错误通用(root、非root)

目录

root

非root


Linux服务器ImportError: libGL.so.1: cannot open shared object file: No such file or directory为例

root

pip安装命令:pip install python-opencv

先安装apt-file。
 apt-get update
 apt-get install apt-file
 apt-file update

然后寻找该依赖库:

apt-file search libXrender.so.1

根据提示安装合适的依赖库:

扫描二维码关注公众号,回复: 14755309 查看本文章

apt-get install libxrender1

 apt 命令提供了查找、安装、升级、删除某一个、一组甚至全部软件包的命令,而且命令简洁而又好记。

apt 命令执行需要超级管理员权限(root)。

Linux apt 命令 | 菜鸟教程

参考链接:

pip安装cv2库报错:ImportError: libXrender.so.1: cannot open shared object file: No such file or directory_little peanut的博客-CSDN博客 

非root

sudo apt install libxrender1

sudo命令以系统管理者的身份执行指令,也就是说,经由 sudo 所执行的指令就好像是 root 亲自执行

 需要输入用户登陆服务器的密码

猜你喜欢

转载自blog.csdn.net/qq_28838891/article/details/126900901