recently encountered an error using python to unzip rar.
installation is the rarfile package, but the implementation of decompression error, the Internet to find a lot of methods have not solved.
import rarfile
path1 = "E://test.rar"
with rarfile.RarFile(path1) as rf:
rf.extractall()
currently the main online solutions are as follows:
1. Put winrar. Exe under python project venv – scripts. 2. Install unrar on Windows and configure environment variables.
I tried the first method and found that it did not solve the problem, and I did not try the second method because I could not find a suitable installation package.
considering that winrar program is installed on the machine, so inspired by the second method, configure winrar path in the system environment variable, and then restarts pycharm, and the problem is found to be perfectly solved.
Read More:
- [Solved] Windows Python Upzip rar File Error: Cannot find working tool
- [Solved] supervisor Error: /usr/local/lib/python2.7/dist-packages/pkg_resources/py2_warn.py:22: UserWarning: Setuptools will stop working on Python 2
- npm install Error: stack Error: Can’t find Python executable “python”
- Invalid python sd, Fatal Python error: init_fs_encoding: failed to get the Python cod [How to Solve]
- NPM install Error: gyp ERR! stack Error: Could not find any Python installation to use
- Jupyter notebook Failed to Switch to the Virual Environment: DLL load failed python.exe could not find the entry
- [Solved] Python Relative Reference Error: ImportError: attempted relative import with no known parent package
- CMake Error at Could NOT find Python3 [Solved]
- Importerror: DLL load failed: unable to find the specified module in Python
- [Solved] NPM install Error: check python checking for Python executable python2 in the PATH
- [Solved] Python Error: “RuntimeError: ‘cryptography‘ package is required for sha256_password or caching_sha2_pas”
- [Solved] Python Selenium Error: AttributeError: ‘WebDriver‘ object has no attribute ‘find_element_by_xpath‘
- [Solved] PyInstaller Error: ValueError: too many values to unpack
- Python recursively traverses all files in the directory to find the specified file
- How to Solve Python WARNING: Ignoring invalid distribution -ip (e:\python\python_dowmload\lib\site-packages)
- Copy the python3 installation package to Linux and run it. Error while loading shared libraries: libpython3.6. M.so. 1.0
- ValueError: need more than 1 value to unpack
- [Solved] deepin python Message: unknown error: cannot find Chrome binary
- [leetcode] 295. Find Median from Data Stream Python
- [Solved] torchvision Error: UserWarning: Failed to load image Python extension: Could not find module