Conda install to offline computer with different OS

Hi all,
I know this question has been asked before, but the answers were not clear and I would appreciate if someone could describe the steps involved. I need to download conda, python, and pip to an offline computer that has a different operating system from my online computer.

What I need to do is:

  • Install conda, python, and pip to offline computer. I have downloaded the source files on my online computer. I am unsure how to install these files to my offline computer (with the downloaded Python version as the default python for a conda environment).
  • Install python packages (geopandas, sklearn, etc.) and all their dependencies into offline computer with newly created environment.

Thanks in advance!

constructor is the tool you are looking for. It has a --platform flag you can set to the target platform (e.g. osx-arm64 for macOS M1). However, the cross-building features are not well tested, so expect some rough edges. Theoretically, from a Linux machine you can build .sh installers for Linux and macOS, and .exe for Windows (you need to install NSIS).

What are your platforms (build and target)? Assuming you are on Linux, targeting macOS, you’d need:

  1. conda create -n constructor constructor
  2. conda activate constructor
  3. The following file:
name: MyInstaller  # customize as needed
version: 1.0  # same here
installer_type: sh
channels:
  - conda-forge
specs:  # this is the base environment
  - python
  - conda
  - pip
extra_envs:
  custom_name:  # customize to taste
    specs:
      - geopandas
      - sklearn
  1. Save it as construct.yaml in a location of choice, and from that location, run constructor --platform osx-arm64 ./
  2. You’ll obtain a .sh file you can run on the target machine with bash, as in bash MyInstaller.sh.
1 Like