{"id":5675,"library":"openmim","title":"MIM (OpenMMLab Install Manager)","description":"MIM is the official command-line utility for managing OpenMMLab packages. It simplifies the installation of complex deep learning libraries, especially those with specific CUDA and PyTorch dependencies, by providing a unified interface for installation, downloading models, and dataset management. It aims to reduce common installation pitfalls for OpenMMLab projects. The current version is 0.3.10, and it generally releases new versions every 1-2 months.","status":"active","version":"0.3.10","language":"en","source_language":"en","source_url":"https://github.com/open-mmlab/mim","tags":["OpenMMLab","ML","deep learning","package manager","CLI","model downloader"],"install":[{"cmd":"pip install openmim","lang":"bash","label":"Install openmim"}],"dependencies":[],"imports":[{"note":"OpenMMLab's MIM is primarily a command-line interface tool. While it can be invoked directly from the shell as 'mim', using 'python -m mim' programmatically (e.g., via subprocess) ensures the correct Python environment is used. There are no direct Python imports like `from mim import install` for end-user functionality.","symbol":"mim","correct":"import subprocess\nsubprocess.run(['python', '-m', 'mim', 'command', 'args'])"}],"quickstart":{"code":"import subprocess\nimport sys\n\n# Install a core OpenMMLab package, e.g., mmcv-full (with CUDA support)\nprint('Installing mmcv-full using mim...')\ninstall_cmd = [sys.executable, '-m', 'mim', 'install', 'mmcv-full']\nresult = subprocess.run(install_cmd, capture_output=True, text=True)\nprint('STDOUT:', result.stdout)\nprint('STDERR:', result.stderr)\nif result.returncode == 0:\n    print('mmcv-full installed successfully.')\nelse:\n    print('Failed to install mmcv-full.')\n    \n# You can also download a pretrained model\nprint('\\nDownloading a MMYOLO model using mim...')\ndownload_cmd = [sys.executable, '-m', 'mim', 'download', 'mmyolo', '--config', 'yolov8_s_syncbn_fast_8xb16-500e_coco', '--dest', '.']\nresult = subprocess.run(download_cmd, capture_output=True, text=True)\nprint('STDOUT:', result.stdout)\nprint('STDERR:', result.stderr)\nif result.returncode == 0:\n    print('Model downloaded successfully.')\nelse:\n    print('Failed to download model.')","lang":"python","description":"This quickstart demonstrates how to use `openmim` programmatically to install an OpenMMLab package (like `mmcv-full`) and download a pretrained model configuration. `mim` handles complex dependencies, including CUDA toolkits for `mmcv-full`. The `python -m mim` invocation is used to ensure compatibility with the current Python environment."},"warnings":[{"fix":"Use `mim` for all OpenMMLab package installations and their core dependencies. If `pip` must be used for other parts of the project, ensure `mim` has full control over the OpenMMLab stack.","message":"Mixing `mim install` with direct `pip install` for core OpenMMLab dependencies (e.g., `mmcv`, `mmengine`) can lead to version conflicts or broken installations. It's recommended to let `mim` manage these core packages exclusively.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always invoke MIM using `python -m mim` instead of `mim` directly when executing from scripts or when in doubt about the active Python environment.","message":"For environments with multiple Python installations or complex PATH settings, using `python -m mim` is more reliable than just `mim` to ensure the correct Python interpreter and associated environment are used for the installation. This pattern was officially supported since v0.3.1.","severity":"gotcha","affected_versions":"< 0.3.1 (less robust)"},{"fix":"Upgrade to `openmim` version `0.3.6` or newer using `pip install --upgrade openmim`.","message":"Users on `openmim` versions older than `0.3.6` might encounter an `AssertionError` during initial setup due to an issue with `pip` and `setuptools` import order.","severity":"gotcha","affected_versions":"< 0.3.6"},{"fix":"Upgrade to `openmim` version `0.3.4` or newer to avoid `distutils.version` deprecation warnings.","message":"Older versions of `openmim` used `distutils.version` internally, which has been deprecated in Python. While this might not directly break user code, it could lead to warnings from the Python interpreter.","severity":"deprecated","affected_versions":"< 0.3.4"}],"env_vars":null,"last_verified":"2026-04-12T00:00:00.000Z","next_check":"2026-07-11T00:00:00.000Z"}