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

mamba env export --json --from-history is broken in v2 #3582

Closed
3 tasks done
mathbunnyru opened this issue Nov 7, 2024 · 3 comments · Fixed by #3590
Closed
3 tasks done

mamba env export --json --from-history is broken in v2 #3582

mathbunnyru opened this issue Nov 7, 2024 · 3 comments · Fixed by #3590

Comments

@mathbunnyru
Copy link
Contributor

Troubleshooting docs

  • My problem is not solved in the Troubleshooting docs

Anaconda default channels

  • I do NOT use the Anaconda default channels (pkgs/* etc.)

How did you install Mamba?

Micromamba

Search tried in issue tracker

mamba, env, export, from-history

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I didn't try

Describe your issue

When I run mamba env export --json --from-history it produces invalid json file:

{
  "channels": [
    "conda-forge"
  ],
  "dependencies": [
    "jupyter_core",
    "mamba",
    "python=3.12",
  ],
  "name": "base",
  "prefix": "/opt/conda"
}

Note: --from-history flag is important here, without it everything is ok, the json is invalid due to , in the last element of dependencies.

mamba info / micromamba info

libmamba version : 2.0.3
          mamba version : 2.0.3
           curl version : libcurl/8.10.1 OpenSSL/3.3.2 zlib/1.3.1 zstd/1.5.6 libssh2/1.11.0 nghttp2/1.64.0
     libarchive version : libarchive 3.7.4 zlib/1.2.13 liblzma/5.2.6 bz2lib/1.0.8 liblz4/1.9.3 libzstd/1.5.6
       envs directories : /opt/conda/envs
          package cache : /opt/conda/pkgs
                          /home/jovyan/.mamba/pkgs
            environment : base
           env location : /opt/conda
      user config files : /home/jovyan/.mambarc
 populated config files : /opt/conda/.condarc
       virtual packages : __unix=0=0
                          __linux=6.10.11=0
                          __glibc=2.39=0
                          __archspec=1=aarch64
               channels : https://conda.anaconda.org/conda-forge/linux-aarch64
                          https://conda.anaconda.org/conda-forge/noarch
       base environment : /opt/conda
               platform : linux-aarch64

Logs

No response

environment.yml

No response

~/.condarc

No response

@mathbunnyru
Copy link
Contributor Author

mathbunnyru commented Nov 7, 2024

Related to: #3492

The --json output was added in https://github.com/mamba-org/mamba/pull/3559/files

@jjerphan you might want to take a look here

@mathbunnyru
Copy link
Contributor Author

mathbunnyru commented Nov 7, 2024

One more bug in the --json output: when running with --json we're only printing channels when it's not empty (https://github.com/mamba-org/mamba/pull/3559/files#diff-da24ec78e2ee34afe1e53af5b3ba02e9f49b61efa2a54dac78e201b9f536e0b2R232), but without --json we're always printing it:.

We should always print it channels no matter if it's empty or not.

@maresb
Copy link
Contributor

maresb commented Nov 7, 2024

I'm running into a different problem of a very similar style in #3583

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

Successfully merging a pull request may close this issue.

2 participants