Offline Installation

Offline Installation of the Python SDK with pip

Installing the Python SDK on a host without network access is possible with the following process.

Prerequisite

To install the Python SDK and its dependencies on an air-gapped computer, you will need another computer with internet access to prepare and download the Comet Python SDK (comet_ml) and its dependencies.

Both computers will need to use the same major Python version (for example 3.7 or 3.8) as the final target environment. You can check with: pip -V.

If pip is not associated with the correct version of Python, replace the pip command with /PATH/TO/python -m pip in the following instructions.

Then make sure both computers are using an up-to-date version of pip and the wheel Python package. On the internet-connected computer first:

  • Update pip and the wheel package with: pip install -U pip wheel
  • Check pip version with: pip -V
  • Check the wheel version with: pip show wheel

Then download the updated pip and wheel packages with: pip download pip wheel. This will download two files in the current directory, for example, ./wheel-0.34.2-py2.py3-none-any.whl and ./pip-20.2.1-py2.py3-none-any.whl. Copy those files to the offline computer and install them with: pip install -U /PATH/TO/pip-20.2.1-py2.py3-none-any.whl then pip install -U /PATH/TO/wheel-0.34.2-py2.py3-none-any.whl.

Finally, you will need to check that both the online and offline computers are using the same Python version and the same ABI tags so you will download the correct dependencies. You can check the current ABI tag by running this code snippet: python -c "from wheel.pep425tags import *; print('{0}{1}-{2}'.format(get_abbr_impl(), get_impl_ver(), get_abi_tag()))"

Downloading the Comet SDK and its dependencies

From the online computer:

  • Create a directory named wheelhouse: mkdir wheelhouse.
  • Move to that directory: cd wheelhouse.
  • Download the Comet SDK with the right Python version: pip download comet_ml or /PATH/TO/python -m pip download comet_ml. This will download a bunch of .whl and .tar.gz files in the current directory.
  • Upload or make the wheelhouse directory accessible from the offline computer.

Installing the Comet SDK and its dependencies

From the offline computer:

  • Activate the target Python environment where you are going to run the experiments.
  • Install the Python SDK with: pip install --no-index --find-links /PATH/TO/wheelhouse comet_ml. This will install the Comet Python SDK and its dependencies using only the local files and won't make an external HTTP call.