{"id":24792,"library":"unrar","title":"unrar","description":"Python bindings for the UnRAR library using ctypes. Provides read-only access to RAR archives with extraction and listing capabilities. Current version 0.4 (stalled). Released on PyPI but no active development. The package wraps the UnRAR DLL/shared library from RARLab.","status":"maintenance","version":"0.4","language":"python","source_language":"en","source_url":"https://github.com/matiasb/python-unrar","tags":["unrar","rar","archive","extraction","ctypes"],"install":[{"cmd":"pip install unrar","lang":"bash","label":"Standard install from PyPI"}],"dependencies":[{"reason":"Required at runtime to open and extract archives. Not bundled with the Python package.","package":"UnRAR shared library (unrar.dll on Windows, libunrar.so on Linux, libunrar.dylib on macOS)","optional":false}],"imports":[{"note":"RarFile is inside the rarfile submodule.","wrong":"from unrar import RarFile","symbol":"RarFile","correct":"from unrar import rarfile"},{"note":"Commonly used from the rarfile submodule.","wrong":null,"symbol":"RarInfo","correct":"from unrar.rarfile import RarInfo"}],"quickstart":{"code":"import os\nfrom unrar import rarfile\nrar_path = 'example.rar'\nif not os.path.exists(rar_path):\n    print('Place a RAR file named example.rar in the current directory.')\nelse:\n    with rarfile.RarFile(rar_path) as rf:\n        for info in rf.infolist():\n            print(info.filename)","lang":"python","description":"List contents of a RAR file using RarFile as a context manager."},"warnings":[{"fix":"Install unrar-free (Linux: apt-get install unrar, macOS: brew install unrar). On Windows, place unrar.dll in PATH.","message":"UnRAR shared library must be installed separately. The Python package does not include the native library.","severity":"gotcha","affected_versions":"all"},{"fix":"Consider alternatives like patool or rarfile (pure Python).","message":"The package is unmaintained (last release 2013). May have compatibility issues with newer Python versions or platforms.","severity":"gotcha","affected_versions":"0.4"},{"fix":"Use a different library for creating RAR archives (e.g., patool with external unrar).","message":"RarFile does not support writing. It is read-only.","severity":"gotcha","affected_versions":"all"},{"fix":"Ensure pip install unrar succeeded and the package is in sys.path.","message":"The unrar module must be importable; sometimes missing because of PYTHONPATH or install issues.","severity":"gotcha","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run: pip install unrar","cause":"The package unrar is not installed.","error":"ImportError: No module named unrar"},{"fix":"Install unrar: apt-get install unrar (Linux), brew install unrar (macOS). For Windows, ensure unrar.dll is in PATH.","cause":"UnRAR shared library not found in system PATH or LD_LIBRARY_PATH.","error":"unrar.rarfile.RarCannotExec: Cannot find unrar library"},{"fix":"Ensure the architecture of unrar.dll matches your Python interpreter.","cause":"Trying to use 64-bit Python with 32-bit unrar.dll (or vice versa).","error":"OSError: [WinError 193] %1 is not a valid Win32 application"},{"fix":"Verify the archive using external tools (unrar t file.rar).","cause":"The RAR file is damaged or not a valid archive.","error":"unrar.rarfile.RarFileError: RAR archive is corrupt"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}