{"record":{"id":"17f09dce369eb6d4","repo":"astral-sh/uv","slug":"conda-environment-files-i-e-are-not-suppo","errorCode":null,"errorMessage":"Conda environment files (i.e., `{}`) are not supported","messagePattern":"Conda environment files \\(i\\.e\\., `(.+?)`\\) are not supported","errorType":"validation","errorClass":"anyhow::Error","httpStatus":null,"severity":"error","filePath":"crates/uv-requirements/src/specification.rs","lineNumber":366,"sourceCode":"                }\n\n                Self {\n                    source_trees: vec![SourceTree::SetupCfg(path.clone())],\n                    ..Self::default()\n                }\n            }\n            RequirementsSource::PylockToml(path) => {\n                if !(path.starts_with(\"http://\") || path.starts_with(\"https://\") || path.exists()) {\n                    return Err(anyhow::anyhow!(\"File not found: `{}`\", path.user_display()));\n                }\n\n                Self {\n                    pylock: Some(path.clone()),\n                    ..Self::default()\n                }\n            }\n            RequirementsSource::EnvironmentYml(path) => {\n                return Err(anyhow::anyhow!(\n                    \"Conda environment files (i.e., `{}`) are not supported\",\n                    path.user_display()\n                ));\n            }\n            RequirementsSource::Extensionless(path) => {\n                let content = if let Some(content) = cache.get(path.as_path()) {\n                    content.clone()\n                } else {\n                    let content = read_file(path, client_builder).await?;\n                    cache.insert(path.clone(), content.clone());\n                    content\n                };\n\n                // Detect if it's a PEP 723 script.\n                if let Some(metadata) = Pep723Metadata::parse(content.as_bytes())? {\n                    Self::from_pep723_metadata(&metadata)\n                } else {\n                    // If it's not a PEP 723 script, assume it's a `requirements.txt` file.","sourceCodeStart":348,"sourceCodeEnd":384,"githubUrl":"https://github.com/astral-sh/uv/blob/f1a42680ff5272232d65748acf338b19778dde24/crates/uv-requirements/src/specification.rs#L348-L384","documentation":"Thrown in from_source_with_cache (crates/uv-requirements/src/specification.rs:366) when a RequirementsSource::EnvironmentYml reaches specification building: uv does not resolve conda packages, so conda environment files are hard-rejected with an explicit message rather than partially parsed (only the pip: section would be usable, which would silently drop conda deps).","triggerScenarios":"`uv pip install -r environment.yml` or `-r conda-env.yaml` where uv's source detection classifies the file as an environment.yml source; also programmatic RequirementsSource::EnvironmentYml(path).","commonSituations":"Migrating from conda/mamba workflows where `pip install -r environment.yml` (with its pip: subsection) was tolerated; handing uv an env file out of habit; CI shared between conda and uv jobs.","solutions":["Extract the `dependencies:` → `- pip:` subsection of environment.yml into a requirements.txt and pass that to uv","Recreate the full environment: conda deps must still be installed with conda/mamba — uv handles only the PyPI part","Consider `uv import` to scaffold a uv project from an existing environment, then maintain deps in pyproject.toml"],"exampleFix":"# before\nuv pip install -r environment.yml\n# after\n# requirements.txt = pip: subsection contents (flask, numpy...)\nuv pip install -r requirements.txt","handlingStrategy":"validation","validationCode":"fn is_environment_yml(path: &Path) -> bool {\n    path.extension().is_some_and(|ext| ext.eq_ignore_ascii_case(\"yml\") || ext.eq_ignore_ascii_case(\"yaml\"))\n        && path.file_stem().is_some_and(|stem| stem.to_string_lossy().contains(\"environment\"))\n}\n\nif is_environment_yml(&path) {\n    // extract the pip: subsection to requirements.txt before passing to uv\n}","typeGuard":null,"tryCatchPattern":"match RequirementsSpecification::from_source(src, &client_builder).await {\n    Err(err) if err.to_string().contains(\"Conda environment files\") => {\n        // convert the file's pip section and retry with a RequirementsTxt source\n    }\n    spec => spec?,\n}","preventionTips":["Never hand conda env files to uv; keep a parallel requirements.txt for PyPI deps","Automate extraction of the pip: subsection in migration scripts","Document that conda-managed deps stay with conda/mamba"],"tags":["uv","conda","environment-yml","unsupported-format","pip-interface"],"backgroundTag":null,"analyzedSha":"f1a42680ff5272232d65748acf338b19778dde24","analyzedAt":"2026-08-16T04:51:47.599Z","schemaVersion":2},"datasetVersion":"2026-08-16T08:17:34.114Z"}