conda / conda-lock

Lightweight lockfile for conda environments
https://conda.github.io/conda-lock/
Other
456 stars 101 forks source link

pip's conda-lock can't get pip dependency located in conda-lock.yml #643

Closed yairshemer1 closed 1 month ago

yairshemer1 commented 1 month ago

Checklist

What happened?

My conda-lock.yml has few pip dependencies. When I use conda-lock install --mamba -n env conda-lock.yml, I'm getting a different behavior depending on the conda-lock executable. conda-lock=2.5.2.

My docker image has conda-lock already installed. When I use it, it installs the environment properly. Specifically, it installs the pip deps.

When I run:

virtualenv -p python3.10 /tmp/venv/
source /tmp/venv/bin/activate
pip install conda-lock==2.5.2
which conda-lock 
> /tmp/venv/bin/conda-lock
conda-lock install --mamba -n env conda-lock.yml

pip packages are not installed in the env, even though the output contains

INFO:root:Installing collected packages: streamlit-super-slider, pymsteams
INFO:root:Successfully installed pymsteams-0.2.2 streamlit-super-slider-0.2.0

where pymsteams and streamlit-super-slider are my pip packages.

Conda Info

No response

Conda Config

No response

Conda list

No response

Additional Context

I'm interested in conda-lock coming from pip because I use hatch, and hatch is pip based. Therefore when I hit hatch run conda-lock it installs the pip's version of conda-lock which leads to an incomplete environment.

It might be that the answer is that conda-lock can't be managed by pip, but I just want to make sure. Any help is appreciated :)

yairshemer1 commented 1 month ago

This was an issue unique to my docker image. It is not generally true.