Skip to content
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

Invalid conda-meta/history path prioritized over configured conda binary #1654

Closed
tl-hbk opened this issue Aug 24, 2024 · 3 comments · Fixed by #1659
Closed

Invalid conda-meta/history path prioritized over configured conda binary #1654

tl-hbk opened this issue Aug 24, 2024 · 3 comments · Fixed by #1659
Labels

Comments

@tl-hbk
Copy link
Contributor

tl-hbk commented Aug 24, 2024

When calling use_python or use_condaenv even if you provide conda=<path to binary> the following code path still gets hit

use_python -> python_config -> python_munge_path -> get_python_conda_info -> python_info_condaenv_find

Some environments I have happened to be created using python -m conda which leads to the following being in the history file

# cmd: /tmp/conda/lib/python3.8/site-packages/conda/__main__.py create --yes --prefix /tmp/envs/foo --file /tmp/spec-file.txt

later calls to conda_binary use this bad value instead of whatever was provided to the original conda arg. Could get_python_conda_info use find_conda first instead of looking through the history file? That way the option reticulate.conda_binary or the environment variable RETICULATE_CONDA can be used even when the history file has a bad value.

    conda <- find_conda()
    if (is.null(conda)) {
        # not base env, parse conda-meta history to find the conda binary
        # that created it
        conda <- python_info_condaenv_find(root)
    }
@tl-hbk tl-hbk changed the title Configurable conda executable when calling use_python Invalid conda-meta/history path prioritized over configured conda binary Aug 24, 2024
@t-kalinowski
Copy link
Member

This sounds reasonable. Would you like to submit a PR?

@tl-hbk
Copy link
Contributor Author

tl-hbk commented Sep 4, 2024

Yeah I'll go ahead and create one

@tl-hbk
Copy link
Contributor Author

tl-hbk commented Sep 4, 2024

@t-kalinowski I've opened the PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants