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

(Micro)mamba fails to load yaml environment files in codespaces #2503

Open
2 tasks done
phillies opened this issue Apr 28, 2023 · 5 comments
Open
2 tasks done

(Micro)mamba fails to load yaml environment files in codespaces #2503

phillies opened this issue Apr 28, 2023 · 5 comments

Comments

@phillies
Copy link

Troubleshooting docs

  • My problem is not solved in the Troubleshooting docs

How did you install Mamba?

Mambaforge

Search tried in issue tracker

yes

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

Not applicable

Describe your issue

When tryinng to install an environment using a yaml file in a github codespace, neither micromamba nor mambaforge mamba find the yaml file, even though the file is there and accessible. I tried both mamba via mambaforge and micromamba. Exact same results.

(base) vscode@codespaces-172891:/tmp$ ls -l env.yml 
-rw-r--rw- 1 vscode vscode 111 Apr 28 10:36 env.yml


(base) vscode@codespaces-172891:/tmp$ micromamba create -n testenv -f env.yml 

                  __    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (1.4.1) supported by @QuantStack

        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack

█████████████████████████████████████████████████████████████


Looking for: ['env.yml']

conda-forge/linux-64                                        Using cache
conda-forge/noarch                                          Using cache
Could not solve for environment specs
The following package could not be installed
└─ env.yml   does not exist (perhaps a typo or a missing channel).


(base) vscode@codespaces-172891:/tmp$ cat env.yml 
name: testenv
channels:
  - conda-forge
dependencies:
  - python >=3.6,<3.7
  - ipykernel >=5.1
  - ipywidgets

mamba info / micromamba info

__    __    __    __
                 /  \  /  \  /  \  /  \
                /    \/    \/    \/    \
███████████████/  /██/  /██/  /██/  /████████████████████████
              /  / \   / \   / \   / \  \____
             /  /   \_/   \_/   \_/   \    o \__,
            / _/                       \_____/  `
            |/
        ███╗   ███╗ █████╗ ███╗   ███╗██████╗  █████╗
        ████╗ ████║██╔══██╗████╗ ████║██╔══██╗██╔══██╗
        ██╔████╔██║███████║██╔████╔██║██████╔╝███████║
        ██║╚██╔╝██║██╔══██║██║╚██╔╝██║██╔══██╗██╔══██║
        ██║ ╚═╝ ██║██║  ██║██║ ╚═╝ ██║██████╔╝██║  ██║
        ╚═╝     ╚═╝╚═╝  ╚═╝╚═╝     ╚═╝╚═════╝ ╚═╝  ╚═╝

        mamba (1.4.1) supported by @QuantStack

        GitHub:  https://github.com/mamba-org/mamba
        Twitter: https://twitter.com/QuantStack

█████████████████████████████████████████████████████████████


     active environment : base
    active env location : /home/vscode/mambaforge
            shell level : 2
       user config file : /home/vscode/.condarc
 populated config files : /home/vscode/mambaforge/.condarc
                          /home/vscode/.condarc
          conda version : 23.1.0
    conda-build version : not installed
         python version : 3.10.10.final.0
       virtual packages : __archspec=1=x86_64
                          __glibc=2.31=0
                          __linux=5.4.0=0
                          __unix=0=0
       base environment : /home/vscode/mambaforge  (writable)
      conda av data dir : /home/vscode/mambaforge/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/linux-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /home/vscode/mambaforge/pkgs
                          /home/vscode/.conda/pkgs
       envs directories : /home/vscode/mambaforge/envs
                          /home/vscode/.conda/envs
               platform : linux-64
             user-agent : conda/23.1.0 requests/2.28.2 CPython/3.10.10 Linux/5.4.0-1106-azure debian/11 glibc/2.31
                UID:GID : 1000:1000
             netrc file : None
           offline mode : False

Logs

No response

environment.yml

name: testenv
channels:
  - conda-forge
dependencies:
  - python >=3.6,<3.7
  - ipykernel >=5.1
  - ipywidgets

~/.condarc

channel_priority: strict
@jonashaag
Copy link
Collaborator

In mamba you need to use env create and your Micromamba invocation seems to be aliased to Mamba?

@phillies
Copy link
Author

micromamba is the installation from the dev container feature (which only installs the micromamba binary as far as I can see), mamba is installed from mambaforge:

(base) vscode@codespaces-172891:/$ ls -ls /usr/local/bin/micromamba 
13320 -rwxrwxr-x 1 root root 13635696 Apr  7 09:31 /usr/local/bin/micromamba
(base) vscode@codespaces-172891:/$ ls -la ~/mambaforge/bin/mamba
-rwxrwxr-x 1 vscode vscode 232 Apr 28 10:00 /home/vscode/mambaforge/bin/mamba
(base) vscode@codespaces-172891:/$ 

Using (micro)mamba env create works. So only the documentation here https://mamba.readthedocs.io/en/latest/user_guide/micromamba.html#yaml-spec-files seems incorrect, as it states micromamba create without env.

@jonashaag
Copy link
Collaborator

Something is wrong with that Micromamba installation cc @maresb

@maresb
Copy link
Contributor

maresb commented Apr 28, 2023

Thanks for the ping!

The aliasing to Mamba indeed looks suspicious, and I suspect that there is some sort of issue with shell activation. It may be an issue with mamba-org/devcontainer-features.

@phillies, could you please explain exactly how you installed Mamba?

My time is unfortunately stretched very thinly at the moment, so I'm not sure when I'll get the chance to look into this.

CC @eitsupi, xref mamba-org/devcontainer-features#18

@phillies
Copy link
Author

phillies commented May 2, 2023

I used github codespaces and "installed" micromamba as a feature in the codespace:

"ghcr.io/mamba-org/devcontainer-features/micromamba:1": {
    "envFile": ".devcontainer/env.yml",
    "envName": "myenv"
}

As this did not work properly, I downloaded Mambaforge-Linux-x86_64.sh and ran the installer with all default settings.

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

No branches or pull requests

3 participants