Run the following Python program error couldn ' t find path to Unrar Library solution:
#!/usr/bin/python#-*-coding:utf-8-*-from unrar Import rarfilefile = Rarfile. Rarfile ('/root/ssl.rar ') file.extractall ('/tmp ')
Note: Rarfile has been installed through PIP3 install Rarfile, but unrar with PIP3 although the prompt is successful but there is a problem, so manually installed under the Unrar package.
1. Install dependent packages
Yum Install gcc gcc-c++
2, download Unrar package, install, compile
wget Http://www.rarlab.com/rar/unrarsrc-5.4.5.tar.gztar zxf unrarsrc-5.4.5.tar.gzcd Unrar
Using the Make Lib command will automatically compile the library file and use the Make Install-lib command to generate the libunrar.so file (typically below the/usr/lib directory)
Make Libmake Install-lib
3. At the end of the/etc/profile file, add
Vi/etc/profileexport unrar_lib_path=/usr/lib/libunrar.so successfully saved and then use the command to make the variable effective source/etc/profile
Python program decompression RAR compression packet error