3

I have a virtual machine on my workplace that has no internet connection (and no docker and git). I want to install Rasa (it's an chatbot installed by Python pip package). Normally you would just type: "pip install rasa". This command doesn't function because the VM has no internet connection.

Now I installed Rasa on my private linux laptop to create a full list of dependencys that Rasa needs. How can I download all these pip packages at once? There are about 50 packages and downloading them all manually step-by-step would take many hours.

My intention is to download all requiered pip packages on my private laptop and move them (the .tar.gz files) to my Linux VM at work. After that I want to install all packages offline so that an internet connection isn't required.

orcam2000
  • 43
  • 1
  • 1
  • 3

1 Answers1

6

Just make a requirements file:

pip freeze > requirements.txt

Then download all the packages and their dependencies:

pip download -r requirements.txt

Copy the packages to the target machine and deploy (into current dir with modules):

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

Further reading is here: How to install packages offline?

florisla
  • 12,668
  • 6
  • 40
  • 47
Jocker
  • 368
  • 1
  • 7
  • 3
    Consider either making sure you are using the same Python version in both places, or making sure you download packages for the version on the offline computer not your laptop. You can do this by running `python --version` on your offline computer and then running this on your laptop: `pip download --python-version=3.9.0 --only-binary=:all: -r requirements.txt`, where you would substitute 3.9.0 for your offline computer's actual version number. – Joel Buursma Oct 17 '22 at 21:31