Install a Python conda environment offline

I typically provide an environment.yml file in Python projects to ensure that everyone is using the same Python environment. Developers are expected to have Miniconda installed and then create the development environment using conda env create --file environment.yml which pulls down the various package dependencies and Python version. But what if a developer does not have internet access. Is there a way to ship a prebuilt conda environment to them? For example, have the environment built on a USB drive which is used to install the Python environment on their computer.

I see three solutions:

  • You can create your own miniconda-like installer with constructor. This can also ship conda so you might be saving one step!
  • You can use conda-pack to embed your environment in a compressed file and send that.
  • Create a Docker image with the necessary files :slight_smile:

Thank you for the suggestions. I’ll look at constructor and conda-pack. Do you know if either of these would install Python too or is it assumed that Python is already installed on the system?

constructor only depends on “always available” system dependencies (bash on Unix, CMD on Windows). Not sure about conda-pack, I haven’t used it as much, but the docs seem to hint at the fact that only an extraction tool is needed?