I've got a custom pypi server running and am wondering how to point all references to https://pypi.python.org/ from there to my custom server?

I want to be able to cover cases of a user calling pip / easy_install of a package (so they don't have to remember to do -i or -f) as well as someone doing python setup.py install using setuptools with install_requires in the setup.py.

Is there some global config or setting I can do to get all these different methods to look at my local server? I imagine doing some network-proxy-type magic to route http://pypi.python.org/ to my custom server would be one way to go but unfortunately that's not an option.

Thanks!

share|improve this question

The following configuration will disable the pypi repository index and make your index the only index used by pip and easy_install. The setuptools install command is basically a shortcut to run the easy_install command on the current project. So, that would work too.

# Add the following to ~/.pydistutils.cfg for easy_install
[easy_install]
index_url = http://localhost:8000/


# Add the following to ~/.pip/pip.conf for pip
[global]
index-url = http://localhost:8000/

Look at easy_install's and pip's documentation for more information.

You could provide your users with a simple python script that creates these config files for them.

share|improve this answer

Since there is no such switch, you could do this for your unix shell environment:

alias pip='`which pip` -i blabla'

You could put this into some .profile file in /etc or in your user's home.

This alias even works for virtual environments. So when you now enter pip install psycopg2, your computer will run

`which pip` -i blabla install psycopg2
share|improve this answer

You need to change 2 files:

For distutils

  • Configuration file: doc

    • ~/.pydistutils.cfg for linux,
    • $HOME/pydistutils.cfg for Windows
  • Content:

    [easy_install]
    index_url = YOUR_URL
    

This concerns commands like python setup.py install.

For pip

  • Configuration file: doc

    • ~/.pip/pip.conf for linux,
    • $HOME/pip/pip.conf for Windows
  • Content:

    [global]
    index-url = YOUR_URL
    

This concerns pip install mypackage commands.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.