Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Offline Installation of python & pip

I need to install python on a sever to run scripts but the server has no access to the internet.

The server has access to a local network that has access to the internet*. I would like to use pip to manage the packages through a local network directory as specified here.

How can I install pip, python and their dependancies on a windows machine, offline so that I can use pip, as specified in the link above to manage the packages I require?

*For Clarity: I have no ability to mirror, hack or otherwise to get information to pass through the local network directly from the internet.

like image 526
Alexander McFarlane Avatar asked May 12 '15 04:05

Alexander McFarlane


1 Answers

The official Python installer for Windows has no other dependencies. It runs completely offline.

For other packages that may have dependencies (that are difficult to install on Windows); Christopher Gholke maintains a list of Windows installers for common Python packages. These are msi installers (or whl files) that are self-contained.

They are designed to work with the official Python installer for Windows - as they use its registry entries to identify the install location.

You can download these and move them to your Windows machine.

Beyond those two - if you have further requirements you can use tools like basket to download packages and then provide the location as a source for offline pip installs; or create your own pip repository.

If you do decide to create a local pip repository, it is better to create a pip proxy (see pypicache for example) this way you are only requesting those packages that are required, rather than trying to mirror the entire cheeseshop.

like image 193
Burhan Khalid Avatar answered Sep 20 '22 16:09

Burhan Khalid