Unidep
Single source of truth with requirements for pip and conda
Install / Use
/learn @basnijholt/UnidepREADME
🚀 UniDep - Unified Conda and Pip Dependency Management 🚀

UniDep streamlines Python project dependency management by unifying Conda and Pip packages in a single system. Learn when to use UniDep in our FAQ.
Handling dependencies in Python projects can be challenging, especially when juggling Python and non-Python packages. This often leads to confusion and inefficiency, as developers juggle between multiple dependency files.
- 📝 Unified Dependency File: Use either
requirements.yamlorpyproject.tomlto manage both Conda and Pip dependencies in one place. - ⚙️ Build System Integration: Integrates with Setuptools and Hatchling for automatic dependency handling during
pip install ./your-package. - 💻 One-Command Installation:
unidep installhandles Conda, Pip, and local dependencies effortlessly. - ⚡️ Fast Pip Operations: Leverages
uv(if installed) for faster pip installations. - 🏢 Monorepo-Friendly: Render (multiple)
requirements.yamlorpyproject.tomlfiles into one Condaenvironment.yamlfile and maintain fully consistent global and per sub packageconda-lockfiles. - 🌍 Platform-Specific Support: Specify dependencies for different operating systems or architectures.
- 🔧
pip-compileIntegration: Generate fully pinnedrequirements.txtfiles fromrequirements.yamlorpyproject.tomlfiles usingpip-compile. - 🔒 Integration with
conda-lock: Generate fully pinnedconda-lock.ymlfiles from (multiple)requirements.yamlorpyproject.tomlfile(s), leveragingconda-lock. - 🥧 Pixi Support: Generate
pixi.tomlfiles from your dependency files, enabling Pixi-based workflows while keeping UniDep as the single source of truth. - 🤓 Nerd stats: written in Python, >99% test coverage, fully-typed, all Ruff's rules enabled, easily extensible, and minimal dependencies
unidep is designed to make dependency management in Python projects as simple and efficient as possible.
Try it now and streamline your development process!
<!-- toc-start -->[!TIP] Check out the example
requirements.yamlandpyproject.tomlbelow.
:books: Table of Contents
<!-- START doctoc generated TOC please keep comment here to allow auto update --> <!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->- :rocket: Bootstrap from Scratch
- :package: Installation
- :memo:
requirements.yamlandpyproject.tomlstructure - :jigsaw: Build System Integration
- :desktop_computer: As a CLI
- ❓ FAQ
- Q: When to use UniDep?
- Q: Just show me a full example!
- Q: Uses of UniDep in the wild?
- Q: How do I force PyPI instead of a local path for one dependency?
- Q: How do I ignore a local dependency entirely?
- Q: A submodule brings its own copy of package X. How do I avoid conflicts?
- Q: How is this different from conda/mamba/pip?
- Q: I found a project using unidep, now what?
- Q: How to handle local dependencies that do not use UniDep?
- Q: Can't Conda already do this?
- Q: What is the difference between
conda-lockandunidep conda-lock? - Q: What is the difference between
hatch-conda/pdm-condaandunidep?
- :hammer_and_wrench: Troubleshooting
- :warning: Limitations
:rocket: Bootstrap from Scratch
To get started quickly with UniDep, run the following command. This will download and install micromamba (recommended for fast Conda environment management), uv (recommended for faster pip installations), and then install UniDep:
"${SHELL}" <(curl -LsSf raw.githubusercontent.com/basnijholt/unidep/main/bootstrap.sh)
[!NOTE] Micromamba and uv are recommended to optimize your installation experience, but they are not required if you prefer to use your existing Conda and pip setup.
<details> <summary>Pin the hash of the bootstrap script with:</summary> <!-- CODE:BASH:START --> <!-- HASH=$(git log -n 1 --pretty=format:"%H" -- bootstrap.sh) --> <!-- echo '```bash' --> <!-- echo '"${SHELL}"' '<(curl -LsSf raw.githubusercontent.com/basnijholt/unidep/'"$HASH"'/bootstrap.sh)' --> <!-- echo '```' --> <!-- CODE:END --> <!-- OUTPUT:START --> <!-- ⚠️ This content is auto-generated by `markdown-code-runner`. -->[!WARNING] NEVER! run scripts from the internet without understanding what they do. Always inspect the script first!
"${SHELL}" <(curl -LsSf raw.githubusercontent.com/basnijholt/unidep/939246571b65004391c425eb6df713303663054a/bootstrap.sh)
<!-- OUTPUT:END -->
</details>
:package: Installation
To install unidep, run one of the following commands that use pipx (recommended), pip, or conda:
pipx install "unidep[all]" # Recommended (install as a standalone CLI)
or
pip install "unidep[all]"
or
conda install -c conda-forge unidep
:memo: requirements.yaml and pyproject.toml structure
unidep allows either using a
requirements.yamlfile with a specific format (similar but not the same as a Condaenvironment.yamlfile) orpyproject.tomlfile with a[tool.unidep]section.
Both files contain the following keys:
- name (Optional): For documentation, not used in the output.
- channels: List of conda channels for packages, such as
conda-forge. - dependencies: Mix of Conda and Pip packages.
- local_dependencies (Optional): List of paths to other
requirements.yamlorpyproject.tomlfiles to include. - optional_dependencies (Optional): Dictionary with lists of optional dependencies.
- platforms (Optional): List of platforms that are supported (used in
conda-lock).
Whether you use a requirements.yaml or pyproject.toml file, the same information can be specified in either.
Choose the format that works best for your project.
Example
Example requirements.yaml
Example of a requirements.yaml file:
name: example_environment
channels:
- conda-forge
dependencies:
- numpy # same name on c
Related Skills
node-connect
339.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
83.9kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
339.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
commit-push-pr
83.9kCommit, push, and open a PR
