Registry / devops / mkdocs-get-deps

mkdocs-get-deps

JSON →
library0.2.2pypypiunverified

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.

devopsweb-framework
pip install mkdocs-get-deps
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

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.

# Create a sample MkDocs project (if you don't have one) # mkdocs new my-docs # cd my-docs # Assuming you have an mkdocs.yml in the current directory, e.g., with a plugin configured: # plugins: # - search # Print the inferred dependencies mkdocs get-deps # Install the inferred dependencies pip install $(mkdocs get-deps)
mkdocs-get-deps --version
Debug
Known issues
gotchaDirectly 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.
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.
affects: All
gotcha`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.
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.
affects: All
gotchaIt 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.
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).
affects: All
gotchaAttempting 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.
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)`.
affects: All
breakingThe `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`.
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)`.
affects: All
Errors
Common errors & fixes
mkdocs-get-deps: command not found
The `mkdocs-get-deps` executable is not in your system's PATH, or the package was not installed correctly.
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`.
ModuleNotFoundError: No module named 'mergedeep'
`mkdocs-get-deps` (or an underlying dependency it relies on) requires the `mergedeep` package, which is not installed in your current Python environment.
fix
Install the missing dependency: `pip install mergedeep`.
ERROR - Config value: 'plugins'. Error: The "<plugin_name>" plugin is not installed
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.
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.
ERROR - Config value: 'markdown_extensions': Failed to load extension 'pymdownx.highlight'. ModuleNotFoundError: No module named 'pymdownx'
A Markdown extension specified in your `mkdocs.yml` is missing its required Python package, or `mkdocs-get-deps` did not correctly infer this dependency.
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.
Upgrade
Version history
0.2.2latest on PyPI
Audit
Dependencies
mkdocsrequiredmkdocs-get-deps is an extra command for MkDocs itself and relies on its ecosystem.
mergedeeprequiredA dependency used for deep merging operations within the tool.
platformdirsrequiredUsed for determining platform-specific directories.
PyYAMLrequiredUsed for parsing the mkdocs.yml configuration file.
Agent activity
9 hits · last 30 days
seranking-bot
3
node
2
ahrefsbot
2
googlebot
1
Resources