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

Micromamba env created from yaml: /bin/micromamba env: No such file or directory #1420

Open
ktmeaton opened this issue Jul 20, 2023 · 2 comments
Labels

Comments

@ktmeaton
Copy link

ktmeaton commented Jul 20, 2023

Error

Very exciting to see micromamba supported, thank you so much! I'm getting this error when I try to use reticulate=1.30 in an environment created from a YAML file with micromamba=1.49. It appears as if reticulate can't find the python binary, and is trying to use the 'conda' binary instead.

Error in normalizePath(conda, winslash = "/", mustWork = TRUE) :
  path[1]="/home/username/.local/bin/micromamba env": No such file or directory
Calls: <Anonymous> ... python_munge_path -> get_python_conda_info -> normalizePath
Execution halted

Environment from CLI (Works)

Creating the environment plainly from the CLI works for me with no errors.

micromamba create -y -n reticulate-from-cli r-base=4.2.1 r-reticulate=1.30
micromamba run -n reticulate-from-cli Rscript -e 'reticulate::use_condaenv("reticulate-from-cli")'

Environment from YAML (Error)

However creating from an environment.yaml file causes errors.

name: reticulate-from-yaml
channels:
  - conda-forge
  - defaults
dependencies:
  - conda-forge::r-base=4.2.1
  - conda-forge::r-reticulate=1.30
micromamba env create  -y -f environment.yaml -n reticulate-from-yaml
micromamba run -n reticulate-from-yaml Rscript -e 'reticulate::use_condaenv("reticulate-from-yaml")'

Error in normalizePath(conda, winslash = "/", mustWork = TRUE) :
  path[1]="/home/username/.local/bin/micromamba env": No such file or directory
Calls: <Anonymous> ... python_munge_path -> get_python_conda_info -> normalizePath
Execution halted

These two environments are otherwise identical with no differences, and both have python3.11 installed.

micromamba -n reticulate-from-cli list > reticulate-from-cli.txt
micromamba -n reticulate-from-yaml list > reticulate-from-yaml.txt

diff reticulate-from-cli.txt reticulate-from-yaml.txt

conda vs mamba vs micromamba

This seems to be restricted to micromamba=1.49 as mamba=1.49 has no errors.

mamba env create -f environment.yaml -n reticulate-from-yaml-mamba
mamba run -n reticulate-from-yaml-mamba Rscript -e 'reticulate::use_condaenv("reticulate-from-yaml-mamba")'

I'm mystified about this error, any feedback would be greatly appreciated!

@zia1138
Copy link

zia1138 commented Aug 24, 2023

@ktmeaton Curious if you use commit ae96550 and use devtools::install('reticulate') to install from source and then run:
use_condaenv("~/path_to_env", "~/pathto_micromamba/micromamba")
Does it work then? It's not an ideal fix since it uses globals, but it does help isolate the issue.
Thanks!

@kmartinez834
Copy link

I ran into a similar problem when trying to use Micromamba.

SOLUTION:

options(reticulate.conda_binary = "/pathto_micromamba/micromamba")
use_condaenv(condaenv = "/path_to_env/micromamba_env")

More info:
I'm running RStudio 4.4.2 hosted through my institution's Debian server. Micromamba 2.0.2-0 is loaded as a module, and I have a micromamba environment in my home directory.

I got the following error using the most recent release reticulate_1.41.0:

use_condaenv(condaenv = "/path_to_env/micromamba_env", conda = "/pathto_micromamba/micromamba")
Error: Unable to find conda binary. Is Anaconda installed?

For some reason, the conda argument isn't working. But setting the conda_binary option works (see solution).

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

No branches or pull requests

4 participants