Skip to content

How do I install MSTICPy in an isolated environment (No Internet)

Ian Hellen edited this page Nov 23, 2021 · 1 revision

The problem here is needing to access PyPI for the MSTICPy package and its dependencies.

The solution is to create an archive of the required files, then move this archive to a location accessible to the offline hosts/VMs.

  1. Download a copy of requirements-all.txt from https://github.com/microsoft/msticpy.
  2. Create a folder to store the downloaded packages

Linux

md mp-packages

Windows

mkdir mp-packages
  1. Create the package archive
python -m pip download -r requirements.txt -d ./mp-packages
  1. (optional) Bundle the package contents into a single file

Linux

tar cvfz mp-packages.tar.gz mp-packages

Windows

tar -cf mp-packages.tar mp-packages

Now move the tar file to a location accessible from the isolated hosts.

  1. Unpack the archive

Linux

mkdir mp-packages
cd mp-packages
tar zxvf mp-packages.tar.gz

Windows

mkdir mp-packages
cd mp-packages
tar -xf mp-packages.tar
  1. Use the -f flag to point pip at the package archive
python -m pip install -f . --no-index msticpy[all]

If you are making the package archive path available via HTTP or SMB share, substitute the URL or share path for the "." in the above example:

python -m pip install -f http://pkg-host/mp-packages --no-index msticpy[all]
python -m pip install -f \\pkg-host\mp-packages --no-index msticpy[all]