{"id":1182,"library":"mkdocs-get-deps","title":"MkDocs Get Deps","description":"mkdocs-get-deps is an extra command-line tool for MkDocs that simplifies dependency management by inferring required PyPI packages from `plugins`, `themes`, and `markdown_extensions` listed in an `mkdocs.yml` configuration file. It outputs the names of these packages, making it easy to pipe them directly to `pip install`. The current version is 0.2.2. It's a low-cadence utility, typically updated in sync with MkDocs or its dependency catalog.","status":"active","version":"0.2.2","language":"python","source_language":"en","source_url":"https://github.com/mkdocs/get-deps","tags":["mkdocs","documentation","dependency management","CLI tool","build tool"],"install":[{"cmd":"pip install mkdocs-get-deps","lang":"bash","label":"Install mkdocs-get-deps"}],"dependencies":[{"reason":"mkdocs-get-deps is an extra command for MkDocs itself and relies on its ecosystem.","package":"mkdocs","optional":false},{"reason":"A dependency used for deep merging operations within the tool.","package":"mergedeep","optional":false},{"reason":"Used for determining platform-specific directories.","package":"platformdirs","optional":false},{"reason":"Used for parsing the mkdocs.yml configuration file.","package":"PyYAML","optional":false}],"imports":[],"quickstart":{"code":"# Create a sample MkDocs project (if you don't have one)\n# mkdocs new my-docs\n# cd my-docs\n\n# Assuming you have an mkdocs.yml in the current directory, e.g., with a plugin configured:\n# plugins:\n#   - search\n\n# Print the inferred dependencies\nmkdocs get-deps\n\n# Install the inferred dependencies\npip install $(mkdocs get-deps)","lang":"bash","description":"This quickstart demonstrates how to use `mkdocs get-deps` to identify and then install the Python packages required by your MkDocs project based on its `mkdocs.yml` configuration. It's often chained with `pip install` to automate the setup of a documentation environment."},"warnings":[{"fix":"Run `mkdocs get-deps > requirements.txt` and then `pip install -r requirements.txt`. Manually review and pin versions in `requirements.txt` for production builds.","message":"Directly chaining `pip install $(mkdocs get-deps)` is convenient but does not pin dependency versions. For stable environments (e.g., CI/CD), it's recommended to write dependencies to a `requirements.txt` file and install from there to ensure reproducible builds.","severity":"gotcha","affected_versions":"All"},{"fix":"Manually identify and add the PyPI packages for custom components to your `requirements.txt` file. You can contribute to the MkDocs catalog to include widely used projects.","message":"`mkdocs-get-deps` relies on an official catalog of known MkDocs plugins, themes, and extensions. If you use a custom or very niche plugin/theme not listed in the catalog, `mkdocs get-deps` might not be able to infer its dependencies.","severity":"gotcha","affected_versions":"All"},{"fix":"Before installing or running `mkdocs get-deps`, create and activate a virtual environment (e.g., `python -m venv venv` then `source venv/bin/activate` on Linux/macOS or `.\\venv\\Scripts\\activate` on Windows).","message":"It is highly recommended to use `mkdocs-get-deps` within a Python virtual environment to isolate your project's dependencies from your system's Python installation and prevent dependency conflicts.","severity":"gotcha","affected_versions":"All"},{"fix":"Execute `mkdocs get-deps` in your terminal. If you need to run it programmatically from a Python script, use `import subprocess; subprocess.run(['mkdocs', 'get-deps'], check=True, text=True, capture_output=True)`.","message":"Attempting to run `mkdocs get-deps` directly within a Python script will result in a `SyntaxError`. `mkdocs get-deps` is a command-line utility and must be executed in a shell or through Python's `subprocess` module, not as a direct Python statement.","severity":"gotcha","affected_versions":"All"},{"fix":"Execute `mkdocs get-deps` directly in your shell or, if within a Python script, use `import subprocess; subprocess.run(['mkdocs', 'get-deps'], check=True)`.","message":"The `mkdocs get-deps` command is designed to be run from the command line (shell), not directly as a Python statement within a Python script. Attempting to execute it directly in Python code without using `os.system()` or `subprocess.run()` will result in a `SyntaxError`.","severity":"breaking","affected_versions":"All"}],"env_vars":null,"search_vec":"'0.2.2':59 'build':83 'cadenc':65 'catalog':76 'cli':81 'command':12 'command-lin':11 'configur':36 'current':56 'dep':3,7 'depend':19,75,79 'direct':51 'document':78 'easi':47 'extens':31 'extra':10 'file':37 'get':2,6 'infer':22 'instal':54 'line':13 'list':32 'low':64 'low-cad':63 'make':45 'manag':20,80 'markdown':30 'mkdoc':1,5,16,72,77 'mkdocs-get-dep':4 'mkdocs.yml':35 'name':41 'output':39 'packag':25,44 'pip':53 'pipe':49 'plugin':27 'pypi':24 'requir':23 'simplifi':18 'sync':70 'theme':28 'tool':14,82,84 'typic':67 'updat':68 'util':66 'version':57","created_at":"2026-04-05T14:31:38.367172+00:00","updated_at":"2026-04-16T16:34:47.938160+00:00","problems":[{"fix":"Ensure `mkdocs-get-deps` is installed in your active Python environment. If it is, activate your virtual environment or ensure your PATH includes the Python scripts directory (e.g., `pip install mkdocs-get-deps`). Alternatively, you might try running it as a subcommand of `mkdocs` if available: `mkdocs get-deps`.","cause":"The `mkdocs-get-deps` executable is not in your system's PATH, or the package was not installed correctly.","error":"mkdocs-get-deps: command not found"},{"fix":"Install the missing dependency: `pip install mergedeep`.","cause":"`mkdocs-get-deps` (or an underlying dependency it relies on) requires the `mergedeep` package, which is not installed in your current Python environment.","error":"ModuleNotFoundError: No module named 'mergedeep'"},{"fix":"Manually identify the missing plugin and install it, for example: `pip install mkdocs-material-extensions` (replace `mkdocs-material-extensions` with the actual missing plugin package name). Then, re-run `mkdocs-get-deps` to ensure all other dependencies are captured.","cause":"You have a plugin listed in your `mkdocs.yml` configuration file that has not been installed in your Python environment. This error indicates `mkdocs-get-deps` may not have correctly identified or output this dependency for installation, or you haven't run `pip install` with its output.","error":"ERROR - Config value: 'plugins'. Error: The \"<plugin_name>\" plugin is not installed"},{"fix":"Install the missing Markdown extension package: `pip install pymdown-extensions` (the `pymdownx` module is provided by the `pymdown-extensions` package). Then, re-run `mkdocs-get-deps` to ensure all dependencies are captured and installed.","cause":"A Markdown extension specified in your `mkdocs.yml` is missing its required Python package, or `mkdocs-get-deps` did not correctly infer this dependency.","error":"ERROR - Config value: 'markdown_extensions': Failed to load extension 'pymdownx.highlight'. ModuleNotFoundError: No module named 'pymdownx'"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"mkdocs-get-deps","cli_version":"usage: mkdocs-get-deps [-h] [-v] [-f CONFIG_FILE] [-p PROJECTS_FILE]","type":"library","homepage":null,"github":"https://github.com/mkdocs/get-deps","docs":null,"changelog":"https://github.com/mkdocs/get-deps/releases","pypi":"https://pypi.org/project/mkdocs-get-deps/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","web-framework"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-04-11","next_check":"2026-07-04","install_tag":null}}