{"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":"en","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"}],"env_vars":null,"last_verified":"2026-04-05T00:00:00.000Z","next_check":"2026-07-04T00:00:00.000Z"}