New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conda
shell function injects $CONDA_PREFIX
into $PATH
causing incorrect behavior in conda run
#11174
Comments
@chenghlee do you think this is related to #11072? |
@jezdez That's my suspicion, but I can't exactly prove it. |
Related to issue #11231 |
We've reviewed the work-around in #11257 and decided to remove this from the upcoming 4.12.0 release since we don't have the confidence that it would be an appropriate fix. We'll need to dig more into why #8528 added the |
Potentially related to #11305 |
conda run
does not remove base environment components from $PATH
conda
shell function injects $CONDA_PREFIX
into $PATH
causing incorrect behavior in conda run
As mentioned in yesterday's community call we're bumping this up in severity since it seems to affect a lot of users of Visual Studio Code. |
I was able to work around this by calling conda deactivate first, like this (and then passing to subprocess.check_call in my case):
|
Description
What happened?
The
$PATH
/%PATH%
set byconda run
includes directories from the base environment;conda activate
, on the other hand, removes base environment components from the PATH. This can be problematic, asconda run
andconda activate
can have different executables (and on Windows, DLLs) available to the user.A basic replicating case:
(Note that
${CONDA_ROOT}/bin
gets removed from$PATH
in the activated environment, but not when usingconda run
.)Conda Details
conda info
conda config
conda list
Resolution
It would appear that the
__add_sys_prefix_to_path
shell function added in conda 4.6.12 is the culprit here.Duplicate Issues
conda run
inside already activated environment should be the same as running it outside #11305conda run
sometimes uses python in the base environment #8450The text was updated successfully, but these errors were encountered: