Skip to content Skip to sidebar Skip to footer

How Can I Install Packages Hosted In A Private Pypi Using Setup.py?

I'm trying to write the setup.py install file for a private project, which has both public and private dependencies. The public ones are hosted on PyPI, whereas the private ones ar

Solution 1:

it looks like you didnt specify your host like the doc of simplepy said you need to setup your ~/.pypirc with the good hostname like

To use it run "simplepypi". You can upload packages by:

Modifyyour~/.pypircso it looks like:

    [distutils]
    index-servers=pypilocal

    [local]
    username:<whatever>password:<doesn'tmatter,seeabove>repository:http://127.0.0.1:8000

    [pypi]
    ...

then you'll upload your package on it

python setup.py sdist upload -r local

and could install it from there

pip install -i http://127.0.0.1:8000/pypi <your favorite package>

Hope this will help.

Solution 2:

dependency_links is ignored by default (at least in pip 9.0.1)

In order for it to reach out to your sever you need to add --process-dependency-links

I believe pip 10 will bring a new mechanism, but for now this has got it working for me

I also had to update dependency_links to include the package name, for example:

dependency_links=[
    "http://internal-pyp:5678/simple/your_package_name"
]

Solution 3:

You could make your package as a normal pip package and publish it to the private repo. To install it, you can specify global option --extra-index-url in the config file:

$ cat ~/.pip/pip.conf
[global]
extra-index-url = https://...

Post a Comment for "How Can I Install Packages Hosted In A Private Pypi Using Setup.py?"