mamba-org / mamba

The Fast Cross-Platform Package Manager
https://mamba.readthedocs.io
BSD 3-Clause "New" or "Revised" License
6.68k stars 346 forks source link

[micromamba] after `install --download-only`, `install --offline` can't find `pkgs_dirs` #3218

Open carschandler opened 5 months ago

carschandler commented 5 months ago

Troubleshooting docs

Anaconda default channels

How did you install Mamba?

Micromamba

Search tried in issue tracker

is:issue "offline", is:issue in:title "offline"

Latest version of Mamba

Tried in Conda?

Not applicable

Describe your issue

I have a situation where I need to install an environment on a machine without internet access (Windows machine). My plan is to use micromamba since it is statically linked and I like using it anyway. I am trying to only download the packages required on an online machine (also Windows) and then move them to the offline machine, where I would install them. My environment is defined in an environment.yml (posted below).

I'm trying to do this very bare-bones from a blank slate. I have no rc file defined. After making micromamba.exe available on my PATH, these are the steps I've taken:

  1. Navigate to my project root, where all that exists is environment.yml
  2. mkdir .micromamba
  3. $env:MAMBA_ROOT_PREFIX="$PWD\.micromamba"
  4. micromamba create -n testenv
  5. micromamba install --download-only -f environment.yml
  6. This is the point at which I would move everything in .micromamba over to the offline machine, which I'm simulating by closing my terminal, unplugging my ethernet, and re-opening my project root.
  7. $env:MAMBA_ROOT_PREFIX="$PWD\.micromamba"
  8. micromamba install --offline -f environment.yml Returns
    conda-forge/win-64                                          Using cache
    conda-forge/noarch                                          Using cache
    critical libmamba Specified pkgs_dir does not exist

I thought maybe activating the environment would help but it does not. If I manually define my pkgs_dirs in $env:MAMBA_ROOT_PREFIX\.mambarc then I am able to install, but I am confused as to why I would have to do that when, from the documentation:

This cache is shared by all environments or target prefixes based on the same root prefix. Basically, that cache directory is a subdirectory located at $root_prefix/pkgs/.

If I have my root prefix defined, and have confirmed that all my packages do exist in $env:MAMBA_ROOT_PREFIX\pkgs, then why isn't micromamba pulling from there automatically?

mamba info / micromamba info

libmamba version : 1.5.7
     micromamba version : 1.5.7
           curl version : libcurl/8.2.1-DEV Schannel zlib/1.2.13
     libarchive version : libarchive 3.6.2 zlib/1.2.13 liblzma/5.4.3 bz2lib/1.0.8 liblz4/1.9.4 libzstd/1.5.5
       envs directories : C:\Users\rchandler\projects\micromamba_offline\.micromamba\envs
          package cache : C:\Users\rchandler\projects\micromamba_offline\.micromamba\pkgs
                          C:\Users\rchandler\.mamba\pkgs
                          C:\Users\rchandler\AppData\Roaming\.mamba\pkgs
            environment : testenv (active)
           env location : C:\Users\rchandler\projects\micromamba_offline\.micromamba\envs\testenv
      user config files : C:\Users\rchandler\.mambarc
 populated config files :
       virtual packages : __win=0=0
                          __archspec=1=x86_64
                          __cuda=12.2=0
               channels :
       base environment : C:\Users\rchandler\projects\micromamba_offline\.micromamba
               platform : win-64

Logs

conda-forge/win-64                                          Using cache
conda-forge/noarch                                          Using cache
critical libmamba Specified pkgs_dir does not exist

environment.yml

name: testenv

channels:
  - conda-forge

dependencies:
  - python=3.11
  - black
  - blackd
  - dash
  - debugpy
  - dill
  - icecream
  - ipython
  - jupyter
  - matplotlib
  - netcdf4
  - numpy
  - numpy-stl
  - opencv
  - pandas
  - plotly
  - pyarrow
  - pytest
  - scipy
  - vtk
  - xarray

~/.condarc

None