mamba-org/mamba

'emscripten' is not a valid Platform

cosmicBboy opened this issue · 14 comments

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?

Mambaforge or latest Miniforge

Search tried in issue tracker

'emscripten' is not a valid Platform

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

I have this problem with Conda as well, without using Mamba

Describe your issue

I'm trying to create a xeus python kernel and have the following environment file:

name: xeus-python-kernel
channels:
  - https://repo.mamba.pm/emscripten-forge
  - conda-forge
dependencies:
  - xeus-python
  - pandas

When I try to create an environment from this file:

mamba env create --file environment.yml

I get the following:

Channels:
 - https://repo.mamba.pm/emscripten-forge
 - conda-forge
Platform: osx-64
Collecting package metadata (repodata.json): done
Solving environment: done


==> WARNING: A newer version of conda exists. <==
    current version: 24.3.0
    latest version: 24.4.0

Please update conda by running

    $ conda update -n base -c conda-forge conda



# >>>>>>>>>>>>>>>>>>>>>> ERROR REPORT <<<<<<<<<<<<<<<<<<<<<<

    Traceback (most recent call last):
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/exception_handler.py", line 17, in __call__
        return func(*args, **kwargs)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda_env/cli/main.py", line 43, in do_call
        exit_code = getattr(module, func_name)(arguments, parser)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/notices/core.py", line 131, in wrapper
        return func(*args, **kwargs)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/cli/main_env_create.py", line 169, in execute
        result[installer_type] = installer.install(
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/env/installers/conda.py", line 61, in install
        unlink_link_transaction.download_and_extract()
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/link.py", line 255, in download_and_extract
        self._pfe.execute()
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 771, in execute
        self.prepare()
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/common/io.py", line 85, in decorated
        return f(*args, **kwds)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 750, in prepare
        self.paired_actions.update(
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 751, in <genexpr>
        (prec, self.make_actions_for_record(prec)) for prec in largest_first
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 595, in make_actions_for_record
        extracted_pcrec = next(
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 596, in <genexpr>
        (
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 599, in <genexpr>
        PackageCacheData(pkgs_dir).query(pref_or_spec)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 166, in query
        for pcrec in self._package_cache_records.values()
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 306, in _package_cache_records
        self.load()
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 127, in load
        package_cache_record = self._make_single_record(base_name)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/core/package_cache_data.py", line 369, in _make_single_record
        package_cache_record = PackageCacheRecord.from_objects(
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/auxlib/entity.py", line 790, in from_objects
        return cls(**init_vars)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/auxlib/entity.py", line 743, in __call__
        instance = super().__call__(*args, **kwargs)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/models/records.py", line 418, in __init__
        super().__init__(*args, **kwargs)
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/auxlib/entity.py", line 759, in __init__
        setattr(self, key, kwargs[key])
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/auxlib/entity.py", line 428, in __set__
        self.box(instance, instance.__class__, val),
      File "/usr/local/Caskroom/miniforge/base/lib/python3.10/site-packages/conda/auxlib/entity.py", line 570, in box
        raise ValidationError(val, msg=e1)
    conda.auxlib.exceptions.ValidationError: 'emscripten' is not a valid Platform

`$ /usr/local/Caskroom/miniforge/base/condabin/mamba create --file environment.yml`

  environment variables:
                 CIO_TEST=<not set>
  CONDA_AUTO_UPDATE_CONDA=false
        CONDA_DEFAULT_ENV=pandera-dev
                CONDA_EXE=/usr/local/Caskroom/miniforge/base/bin/conda
         CONDA_NO_PLUGINS=true
             CONDA_PREFIX=/usr/local/Caskroom/miniforge/base/envs/pandera-dev
           CONDA_PREFIX_1=/usr/local/Caskroom/miniforge/base
    CONDA_PROMPT_MODIFIER=
         CONDA_PYTHON_EXE=/usr/local/Caskroom/miniforge/base/bin/python
               CONDA_ROOT=/usr/local/Caskroom/miniforge/base
              CONDA_SHLVL=2
           CURL_CA_BUNDLE=<not set>
         GDAL_DRIVER_PATH=/usr/local/Caskroom/miniforge/base/envs/pandera-dev/lib/gdalplugins
               LD_PRELOAD=<not set>
                     PATH=/usr/local/Caskroom/miniforge/base/envs/pandera-dev/bin:/usr/local/Cas
                          kroom/miniforge/base/condabin:/Users/nielsbantilan/.pyenv/shims:/Users
                          /nielsbantilan/.rbenv/shims:/usr/local/opt/openjdk/bin:/usr/local/bin:
                          /System/Cryptexes/App/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin:/var/run/c
                          om.apple.security.cryptexd/codex.system/bootstrap/usr/local/bin:/var/r
                          un/com.apple.security.cryptexd/codex.system/bootstrap/usr/bin:/var/run
                          /com.apple.security.cryptexd/codex.system/bootstrap/usr/appleinternal/
                          bin:/opt/X11/bin:/Library/Apple/usr/bin:/usr/local/MacGPG2/bin:/Librar
                          y/TeX/texbin:/usr/local/git/bin:/usr/local/go/bin:/Users/nielsbantilan
                          /.cargo/bin
       REQUESTS_CA_BUNDLE=<not set>
            SSL_CERT_FILE=<not set>

     active environment : pandera-dev
    active env location : /usr/local/Caskroom/miniforge/base/envs/pandera-dev
            shell level : 2
       user config file : /Users/nielsbantilan/.condarc
 populated config files : /usr/local/Caskroom/miniforge/base/.condarc
                          /Users/nielsbantilan/.condarc
          conda version : 24.3.0
    conda-build version : not installed
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m2
                          __conda=24.3.0=0
                          __osx=14.2.1=0
                          __unix=0=0
       base environment : /usr/local/Caskroom/miniforge/base  (writable)
      conda av data dir : /usr/local/Caskroom/miniforge/base/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /usr/local/Caskroom/miniforge/base/pkgs
                          /Users/nielsbantilan/.conda/pkgs
       envs directories : /usr/local/Caskroom/miniforge/base/envs
                          /Users/nielsbantilan/.conda/envs
               platform : osx-64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.10.14 Darwin/23.2.0 OSX/14.2.1 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8
                UID:GID : 501:20
             netrc file : /Users/nielsbantilan/.netrc
           offline mode : False


An unexpected error has occurred. Conda has prepared the above report.
If you suspect this error is being caused by a malfunctioning plugin,
consider using the --no-plugins option to turn off plugins.

Example: conda --no-plugins install <package>

Alternatively, you can set the CONDA_NO_PLUGINS environment variable on
the command line to run the command without plugins enabled.

Example: CONDA_NO_PLUGINS=true conda install <package>

Additional context: this command was working for me yesterday. I tried a fresh miniforge install, but that didn't get around the issue.

mamba info / micromamba info

mamba version : 1.5.8
     active environment : pandera-dev
    active env location : /usr/local/Caskroom/miniforge/base/envs/pandera-dev
            shell level : 2
       user config file : /Users/nielsbantilan/.condarc
 populated config files : /usr/local/Caskroom/miniforge/base/.condarc
                          /Users/nielsbantilan/.condarc
          conda version : 24.3.0
    conda-build version : not installed
         python version : 3.10.14.final.0
                 solver : libmamba (default)
       virtual packages : __archspec=1=m2
                          __conda=24.3.0=0
                          __osx=14.2.1=0
                          __unix=0=0
       base environment : /usr/local/Caskroom/miniforge/base  (writable)
      conda av data dir : /usr/local/Caskroom/miniforge/base/etc/conda
  conda av metadata url : None
           channel URLs : https://conda.anaconda.org/conda-forge/osx-64
                          https://conda.anaconda.org/conda-forge/noarch
          package cache : /usr/local/Caskroom/miniforge/base/pkgs
                          /Users/nielsbantilan/.conda/pkgs
       envs directories : /usr/local/Caskroom/miniforge/base/envs
                          /Users/nielsbantilan/.conda/envs
               platform : osx-64
             user-agent : conda/24.3.0 requests/2.31.0 CPython/3.10.14 Darwin/23.2.0 OSX/14.2.1 solver/libmamba conda-libmamba-solver/24.1.0 libmambapy/1.5.8
                UID:GID : 501:20
             netrc file : /Users/nielsbantilan/.netrc
           offline mode : False

Logs

No response

environment.yml

No response

~/.condarc

anaconda_upload: true

conda-build:
  anaconda_token: <redacted>
changeps1: false
report_errors: false

You should remove your token! :)

Regarding the environment.yml - it might only work with micromamba. Or if you want to try something newer and easier, you can give pixi a go. I put together this pixi.toml file today: https://gist.github.com/wolfv/87d54ca24bbfb3c4ec34c9688f5c3de0

Once you have pixi, and the pixi.toml you can run pixi run serve to start a server that builds everything.

PS: I redacted your token but you shold still rotate it! I believe people can see hte edits on Github

You should remove your token! :)

How do I rotate this? Googling around yields no useful info on this

Additional context: this command was working for me yesterday. I tried a fresh miniforge install, but that didn't get around the issue.

The weird thing is this was working for me yesterday on mamba 🤷‍♂️ .

@cosmicBboy you should go to anaconda.org (or from where you got the token), and remove it (or recreate).

Yeah, weird, I believe it might be connected to some server issues then. @DerThorsten or @atrawog migth have more info.

At some point the subdir name also changed from emscripten-32 to emscripten-wasm32.

Not sure if it is related: I got the same error on Read the Docs last week. The mamba command is executed by jupyterlite_xeus in jupyterlite_xeus/create_conda_env.py. I reinstall mamba through the environment file, which just works.

 channels:
   - conda-forge
 dependencies:
+  - mamba

I don't know the reason though... But it just works.

I believe our issues are related emscripten-forge/recipes#927. The temporary workaround that I'm using is to downgrade packages that were releasing on emscripten-forge since around the first week of May.

@wolfv it turns out this is a problem with the rattler-build build packages.
In the index.json of the rattler-build packages is says:

  "platform": "emscripten",
  "subdir": "emscripten-wasm32"

but the platform is expected to be emscripten-wasm32

@LiamBindle now that we know the issue we are working to fix this as soon as possible!

btw I ran into this bug once, then I reinstalled mamba/micromamba in the host environment...now I cannot reproduce it anymore

I reinstall mamba through the environment file, which just works.

Could that mean that the mamba version specified in your readthedocs config for mambaforge is the culprit? We have this in our docs https://github.com/jupyterlite/xeus/blob/main/.readthedocs.yaml#L6

For the record, installing micromamba seems to also be a solution jupyterlite/xeus#89

But this is definitely just a workaround for now

Hmm, it's correct though that teh platform is the first part of the subdir.

It's:

platform: emscripten
arch: wasm32
subdir: emscripten-wasm32

Didn't we patch conda in some way to allow emscripten installation?

Didn't we patch conda in some way to allow emscripten installation?

that was just for building packages with boa and conda-build.
When using conda to install emscripten-wasm32 package we add the target platform to a .condarc
and point conda/mamba to this rc via an env variable (CONDARC I believe)

mhhh...I am more and more confused about this issue.
So it seems that it appeared once we swtichd to rattler-build. But the first time we could upload rattler build packages
was also when we updated the server.