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 cannot find python on Windows #3690

Open
3 tasks done
arthursw opened this issue Dec 13, 2024 · 4 comments
Open
3 tasks done

Micromamba cannot find python on Windows #3690

arthursw opened this issue Dec 13, 2024 · 4 comments
Labels
where::windows Windows-specific issues

Comments

@arthursw
Copy link

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

No entries matching "python" found

Latest version of Mamba

  • My problem is not solved with the latest version

Tried in Conda?

Not applicable

Describe your issue

I did the following steps:

  • download micromamba,
  • renamed it to micromamba.exe,
  • Invoke the hook with .\micromamba.exe shell hook -s powershell | Out-String | Invoke-Expression
  • created an env with micromamba create -n test and activate it with micromamba activate test
  • search for python with mircromamba search python

This gave me the following error:

(test) PS C:\project\micromamba> micromamba search python
Getting repodata from channels...

conda-forge/noarch                                  17.7MB @  10.0MB/s  1.8s
conda-forge/win-64                                  26.1MB @   9.8MB/s  2.6s
No entries matching "python" found
Try looking in a different channel with '--channel'.

Any idea why?

Here is my only config file:

(test) PS C:\project\micromamba> cat C:\Users\ci\.condarc
channels:
  - conda-forge
channel_priority: flexible

I deleted the only existing package cache folder.

The error also occurred when I installed with Invoke-Expression ((Invoke-WebRequest -Uri https://micro.mamba.pm/install.ps1).Content).

The weirdest thing is that I did manage to use micromamba on this machine today ; all the following commands used to work:

Invoke-Webrequest -URI https://github.com/mamba-org/micromamba-releases/releases/download/2.0.4-0/micromamba-win-64 -OutFile micromamba.exe
Set-Location -Path "C:\project\micromamba"
$Env:MAMBA_ROOT_PREFIX="C:\project\micromamba"
.\micromamba.exe shell hook -s powershell | Out-String | Invoke-Expression
micromamba config append channels conda-forge
micromamba config append channels nodefaults
micromamba config set channel_priority flexible
micromamba create -n project python=3.10.8 -y
micromamba activate project
micromamba install "zeroc-ice==3.6.5" -y
pip install "omero-py==5.15.0" "simpleitk>=2.3.1, <2.4"

mamba info / micromamba info

(test) PS C:\project\micromamba> micromamba info

       libmamba version : 2.0.4
     micromamba version : 2.0.4
           curl version : libcurl/8.8.0-DEV Schannel zlib/1.3.1
     libarchive version : libarchive 3.7.2 zlib/1.3.1 liblzma/5.6.2 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.6
       envs directories : C:\Users\ci\AppData\Roaming\mamba\envs
          package cache : C:\Users\ci\AppData\Roaming\mamba\pkgs
                          C:\Users\ci\.mamba\pkgs
                          C:\Users\ci\AppData\Roaming\.mamba\pkgs
            environment : test (active)
           env location : C:\Users\ci\AppData\Roaming\mamba\envs\test
      user config files : C:\Users\ci\.mambarc
 populated config files : C:\Users\ci\.condarc
       virtual packages : __win=10.0.19045=0
                          __archspec=1=x86_64
               channels : https://conda.anaconda.org/conda-forge/noarch
                          https://conda.anaconda.org/conda-forge/win-64
       base environment : C:\Users\ci\AppData\Roaming\mamba
               platform : win-64

Logs

(test) PS C:\project\micromamba> micromamba search python
Getting repodata from channels...

conda-forge/noarch                                  17.7MB @  10.0MB/s  1.8s
conda-forge/win-64                                  26.1MB @   9.8MB/s  2.6s
No entries matching "python" found
Try looking in a different channel with '--channel'.

environment.yml

I have no environment.yml.

~/.condarc

$ cat ~/.condarc
channels:
  - conda-forge
channel_priority: flexible
(test)
@jjerphan jjerphan added the where::windows Windows-specific issues label Dec 13, 2024
@arthursw
Copy link
Author

I think running micromamba env update solved the problem. I think this comes from the fact that I didn't have a default base environment.

Why is the base environment necessary?

@arthursw
Copy link
Author

My bad, running micromamba env update does not help. I'll continue investigating this error.

@arthursw
Copy link
Author

arthursw commented Dec 18, 2024

I compared the cache on two machines (one where micromamba cannot find python, one where it can) with the following script:

from pathlib import Path
import json

cache = Path('C:\\Users\\amasson\\AppData\\Roaming\\mamba\\pkgs\\cache')
# cache = Path('C:\\Users\\ci\\AppData\\Roaming\\mamba\\pkgs\\cache')

for file in sorted(list(cache.glob('*.json'))):
    print(file)
    with open(file, 'r') as f:
        content = json.load(f)
        if 'packages' not in content: continue
        pys = [p for k, p in content['packages'].items() if p['name'] == 'python']
        kys = [k for k, p in content['packages'].items() if p['name'] == 'python']
        print(len(pys))
        del content['packages']
        del content['packages.conda']
        for k in kys:
            if k in content['removed']:
                print(f'The python {k} is in removed!')
        if 'removed' in content:
            del content['removed']
        print(content)
    print('\n\n')

and they both contain 229 python entries:

C:\Users\amasson\AppData\Roaming\mamba\pkgs\cache\1f08abba.json
229
{'info': {'subdir': 'win-64'}, 'repodata_version': 1}

C:\Users\amasson\AppData\Roaming\mamba\pkgs\cache\1f08abba.state.json
C:\Users\amasson\AppData\Roaming\mamba\pkgs\cache\64c641e7.json
0
{'info': {'default_numpy_version': '1.7', 'default_python_version': '2.7', 'platform': 'win', 'arch': 'x86_64', 'subdir': 'win-64'}}

C:\Users\amasson\AppData\Roaming\mamba\pkgs\cache\64c641e7.state.json
C:\Users\amasson\AppData\Roaming\mamba\pkgs\cache\758dc0ed.json
0
{'info': {'default_numpy_version': '1.7', 'default_python_version': '2.7', 'platform': None, 'arch': None, 'subdir': 'noarch'}}

C:\Users\amasson\AppData\Roaming\mamba\pkgs\cache\758dc0ed.state.json
C:\Users\amasson\AppData\Roaming\mamba\pkgs\cache\eb045dd1.json
0
{'info': {'subdir': 'noarch'}, 'repodata_version': 1}


So I don't understand why in one case micromamba says No entries matching "python" found.

@arthursw
Copy link
Author

It might be due to a out-of-memory error, since I got the following message:
Out of memory allocating 56623104 bytes!

However, this error does not appear all the time.

Yet, the command works when I free some memory on my system.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
where::windows Windows-specific issues
Projects
None yet
Development

No branches or pull requests

2 participants