See the Workaround below for additional information.
Workaround:
Installation of Python modules (third-party dependencies) on air-gapped systems with specific example of capturing dependencies for the VMware Aria Automation Config Master plugin:
Capture Python modules for air-gapped install
- From a machine with internet access that is an identical version to the machine which will be targeted for the module install, perform the below steps.
Prerequisites
Procedure
- Create empty virtual env:
python3 -m venv test
cd test
source bin/activate
- Install the required modules that are required into the virtual environment.
Note: This step can be generalized to gather any additional modules that may be required for any other use case. The specific modules used in this are dependencies of the
VMware Aria Automation Config Master plugin.
bin/pip3 install pyjwt==2.4.0 pika==1.3.1 3
- Gather all modules that were installed (will include dependencies now):
bin/pip3 freeze > /tmp/requirements.txt
- Download all of the modules wheel files:
mkdir /tmp/wheel
bin/pip3 download -r /tmp/requirements.txt -d /tmp/wheel
- Check the contents of the tmp directory that contains the dependencies
ls /tmp/wheel
pika-1.3.1-py3-none-any.whl PyJWT-2.4.0-py3-none-any.whl
- Prepare the shippable file:
mv /tmp/requirements.txt /tmp/wheel tar -zcf wheelhouse.tar.gz /tmp/wheel
- Transfer the file to the air-gapped system.
- Install Module(s) on the air-gapped system(s):
tar -zxf wheelhouse.tar.gz
pip3 install -r tmp/wheel/requirements.txt --no-index --find-links tmp/wheel
Note: You may need to consider the "downgrade" scenario if the module already installed is at a higher version than is incompatible.