Import Error: cannot open shared object file: No such file or directory

Table of contents

root

non-root


Linux server ImportError: libGL.so.1: cannot open shared object file: No such file or directory as an example

root

pip installation command: pip install python-opencv

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

Then look for the dependent library:

apt-file search libXrender.so.1

Follow the prompts to install the appropriate dependency library:

apt-get install libxrender1

 The apt command provides commands to find, install, upgrade, and delete a certain, a group or even all software packages, and the commands are concise and easy to remember.

The execution of the apt command requires super administrator privileges (root).

Linux apt command | Novice Tutorial

Reference link:

Pip installs cv2 library error: ImportError: libXrender.so.1: cannot open shared object file: No such file or directory_little peanut's blog-CSDN Blog 

non-root

sudo apt install libxrender1

The sudo command executes the command as the system administrator, that is to say, the command executed via sudo is as if root executes it himself

 Need to enter the password of the user to log in to the server

Guess you like

Origin blog.csdn.net/qq_28838891/article/details/126900901