1

I am currently using an offline Windows 10 environment and I need to use pip to install a package.

The traditional pip install "myPackage.tar.gz" is not working because pip makes a network request and fails because my machine has no internet.

With this in mind I tried the following command to ignore dependency checking. pip install myPackage.tar.gz -f./ --no-index –-no-deps. The command did install “Successfully ” but when I tried to use the package I got a ModuleNotFoundError.

My question is does pip work offline? If not what would be a work around?

Thank you, Marco

MCDevelops
  • 13
  • 2

1 Answers1

1

Do you have those packages already downloaded in your computer? If not, at some point you will need an internet connection.

There's pip download command which lets you download packages without installing them:

pip download -r requirements.txt

(In previous versions of pip, this was spelled pip install --download -r requirements.txt.)

When you have your packages downloaded, use pip install --no-index --find-links /path/to/download/dir/ -r requirements.txt to install what you have previously downloaded, without the need to access on internet

Sara Briccoli
  • 141
  • 3
  • 11