Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
As part of the hacks used in conda-lock, we create a fake Conda environment containing just the package metadata in
$PREFIX/conda-meta/
, and we query this by runningmicromamba list -p fake-conda-env --json
in a subprocess.The v2 changes have broken this process because
micromamba
now checks not just for conda packages but newly for pip packages in thePrefixData::load_site_packages
function by runningpython -q -m pip inspect --local
.The problem I'm now having is that
load_site_packages
expects apython
executable to be present in$PREFIX/bin
. Moreover, it's thispython
executable is then used in thepython -q -m pip inspect --local
command. But in conda-lock's fake environment, we don't have a$PREFIX/bin
, so whenload_site_packages
callsget_python_path
the result is an empty string, and I get the following error message:Note that
/path/to/some/python
is missing before-q -m ...
.What conda-lock is doing with the fake environment is hacky, and is not the responsibility of
libmamba
. But I just want to get it running again with v2, so I hope that you consider accepting this patch to allow me to disable the functionality from conda-lock by setting an environment variable. I expect only conda-lock to use this, so I don't think we need to document it.(Note that I have tried other workarounds such as adding a fake
python
script to my fake conda environment, but on Windows thewhich_in
helper only seems to detect.exe
files and not.bat
scripts, so that would require me to compile binaries which is not so viable for a pure Python project like conda-lock. I am open to other suggestions.)Thanks for your consideration!