Skip to content

conda-lock will crash with a key error if pip is not included in the environment file on some platforms #843

@schuylermartin45

Description

@schuylermartin45

Checklist

  • I added a descriptive title
  • I searched open reports and couldn't find a duplicate

What happened?

I am currently developing a new closed-source project that is using conda exclusively. I am not publishing this project on PyPi; I do not need pip in any capacity. I do not have a pyproject.toml. I am using conda and conda-lock to manage the environment within a Docker container.

When conda-lock is run from a GitHub Workflow container, I get a series of cascading KeyError exceptions. Here is a partially redacted log:

+ conda-lock -f environment.base.yaml -f environment.dev.yaml -p linux-64 -p linux-aarch64 --lockfile conda-lock.dev.yaml
Locking dependencies for ['linux-64', 'linux-aarch64']...
INFO:conda_lock.conda_solver:linux-64 using specs ['python 3.13.*', 'conda 25.7.0.*', 'pytest 8.4.1.*', ...]
Traceback (most recent call last):
  File "/home/runner/.local/conda/envs/test/lib/python3.13/site-packages/conda_lock/lockfile/__init__.py", line 34, in _seperator_munge_get
    return d[key]
           ~^^^^^
KeyError: 'pip'
...

I have not been able to reproduce this locally on my osx-arm64 machine or in a temp docker container. But if I add:

  # renovate: datasource=conda depName=main/pip
  - pip=25.2

to my environment file, the issue goes away from our GitHub workflow automation and conda-lock works just as before. All dependencies are marked with datasource=conda and we use conda-lock to setup our dev and prod containers. We have been able to run tests and execute code without pip in our containers.

pip is not (knowingly) installed in the PATH of either my local conda environment where I have run this lock file command, nor is it intentionally being installed in our GitHub workflow.

Thanks!

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions