1. Remove old .venv and create a new one for your Python version.

  2. Install needed packages.

    pip install <packages> ...
  3. Write installed packages and their dependencies to requirements.txt.

    pip freeze > requirements.txt
  4. Download packages. Note that pip donwload may download tar.gz files without dependencies for building, while pip wheel won’t.

    pip wheel -r requirements.txt
  5. Move all whl files to the offline system.

  6. Install packages on the offline system.

    pip install -r requirements.txt --no-index --find-link .