Question

I am looking to install django-extensions and its dependancies (particularly six) without ever hitting the internet. I have the tarballs for both django-extensions and six, so am able to install offline. However, I see in my logs that pip firsts tries to find six on pypi before checking locally. Instead, I want to force the installer to never check pypi.

Log output (this is before I downloaded the six tarball, so please ignore the local packages error)

Installed /usr/local/lib/python2.7/site-packages/django_extensions-1.2.5-py2.7.egg

Processing dependencies for django-extensions==1.2.5

Searching for six

Reading http://pypi.python.org/simple/six/

Download error: [Errno -3] Temporary failure in name resolution -- Some packages may not be found!

Couldn't find index page for 'six' (maybe misspelled?)

Scanning index of all packages (this may take a while)

Reading http://pypi.python.org/simple/

Download error: [Errno -3] Temporary failure in name resolution -- Some packages may not be found!

No local packages or download links found for six

Was it helpful?

Solution

U may try:

1) Extract the tarballs and execute python setup.py install in the extracted directories.

2) Or if u want to use pip insistently, first u must download the pip package: pip install --download /temp_download_dir package_name==version ("==version" is optional) and u may install the pip package with pip install --no-index --find-links /temp_download_dir package_name

OTHER TIPS

The easy answer to your question is to pass the --no-index option to pip, which will avoid checking the index for packages.

You really need to setup a local pypi mirror and just point pip to that mirror. This is what I do at work where machines are restricted from the Internet. It can get a bit complicated because it requires setting up of a web server (see pypiserver and this blog which talks about setting up mirrors as per pep-381).

If that's not an option for you, the easiest way to do this is to use basket. Once you install it (using pip), just ask it to download packages:

$ basket init # initialize the directory
Repository has been created: ~/.basket
$ basket download django-extensions # this will download any dependencies as well

Then, move the ~/.basket directory to your machine without Internet, and run:

pip install --no-index -f file:///path/to/.basket django-extensions
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top