{"id":24786,"library":"unidep","title":"UniDep","description":"UniDep unifies Conda and Pip requirements management by parsing a single requirements.yaml file to generate conda environment.yml, pip requirements.txt, pixi.toml, and setuptools dynamic dependencies. Current version: 3.1.0. Release cadence: regular minor releases following semantic versioning.","status":"active","version":"3.1.0","language":"python","source_language":"en","source_url":"https://github.com/basnijholt/unidep","tags":["conda","pip","dependency-management","requirements","monorepo"],"install":[{"cmd":"pip install unidep","lang":"bash","label":"Install from PyPI"}],"dependencies":[],"imports":[{"note":"The main class is exposed at the top-level package.","wrong":"from unidep.unidep import UniDep","symbol":"UniDep","correct":"from unidep import UniDep"},{"note":"parse_requirements is a public top-level function.","wrong":"from unidep.utils import parse_requirements","symbol":"parse_requirements","correct":"from unidep import parse_requirements"}],"quickstart":{"code":"from unidep import UniDep\nimport os\n\n# Create a simple requirements.yaml content as string\nreq_yaml = \"\"\"\n# requirements.yaml\ndependencies:\n  - python >=3.9\n  - pip\n  - pip:\n    - requests\n\"\"\"\nimport tempfile\nwith tempfile.NamedTemporaryFile(mode='w', suffix='.yaml', delete=False) as f:\n    f.write(req_yaml)\n    req_file = f.name\n\n# Parse and generate conda environment.yml\nud = UniDep(req_file)\nenv = ud.to_conda_env()\nprint(env)\nos.unlink(req_file)\n","lang":"python","description":"Parse a requirements.yaml file and output a conda environment.yml dict."},"warnings":[{"fix":"Upgrade configuration if using new dictionary format, but note that v1.x consumers will break.","message":"In version 2.0.0, the `local_dependencies` field schema changed to support a dictionary format. v1.x cannot read v2.0.0 files using the new format.","severity":"breaking","affected_versions":"2.0.0+"},{"fix":"Use `--output-dir` flag to specify a safe output directory.","message":"The `unidep` command-line interface writes files in the current directory by default. Always verify your working directory to avoid overwriting existing files.","severity":"gotcha","affected_versions":"all"},{"fix":"Explicitly list the package in both conda and pip sections if you need conda to install it; use `conda:` and `pip:` keys precisely.","message":"When using pip-only packages in a conda environment, UniDep may demote them to pip dependencies. This can cause runtime import errors if the package is unavailable via conda.","severity":"gotcha","affected_versions":">=2.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run `pip install unidep` to install the package.","cause":"UniDep is not installed.","error":"ModuleNotFoundError: No module named 'unidep'"},{"fix":"Ensure your YAML file starts with `dependencies:` followed by the list of dependencies.","cause":"The requirements.yaml file is missing the top-level 'dependencies' key.","error":"KeyError: 'dependencies'"},{"fix":"Validate your YAML file with a YAML linter; ensure proper indentation and format per the UniDep spec.","cause":"Invalid YAML syntax, often due to trailing colons or incorrect indentation.","error":"yaml.scanner.ScannerError: mapping values are not allowed here"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}