I added a static application to create a personal package index, similar to PyPI but containing customized packages (eg, a tarball of PIL with tweaked Library pointers). Now I want that when I run pip install something, the lookup to retrieve the package is done against my personal package index first and then, only if no package has been found there, on PyPI (like an override).

I tried this and it worked (PIL 1.1.7 locally, PIL 1.1.7 on PyPI):

pip install --find-links http://packages.myusername.webfactional.com PIL

but reading the docs about alternate package repositories I'm not sure this command does what I want:

Like --extra-index-url, --find-links is additive by default, it does not replace or supersede the index. All package sources are checked, and the latest qualifying version for every requested package is used. If you want only your --find-links URL used as package source, you need to pair it with --no-index.

Does pip install Package 1.1, if it finds Package 1.0 on the local index and Package 1.1 on PyPI? In this case, how to force pip to install the package found on the local index? I can't use --no-index to exclude the default index because it is meant to be used as the fallback package repository.

asked 29 Feb '12, 20:26

Guandalino's gravatar image

accept rate: 0%

You should be able to specify a version to make it use the one in your index for that package,

You can also request a specific version (pip install SomePackage==1.0.4)
permanent link

answered 29 Feb '12, 21:15

johns's gravatar image

johns ♦♦
accept rate: 23%

edited 29 Feb '12, 21:17

The thing that worried me with your solution was that PyPI got precedence over the local package repo. I tested your suggestion and instead the first repository considered is the one given with the --find-links URL. Great.

(01 Mar '12, 05:06) Guandalino Guandalino's gravatar image
Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:


question asked: 29 Feb '12, 20:26

question was seen: 3,311 times

last updated: 01 Mar '12, 05:06

Features & prices    Sign up    Contact us    Affiliate program    Support    Legal    Jobs    Blog    Control panel login
© Copyright 2003-2015 Swarma Limited - WebFaction is a service of Swarma Limited