Monday, 18 September 2023

Install specific package from specific index

I have built a package (let's call it mypackage) that depends on a well-known third-party module (namely pandas), available on PyPi. I've uploaded mypackage on a custom PyPi-like server (pypicustom). I'm struggling to install it on environments where all I have access to is a mirror to PyPi (let's call it pypiproxy).

pip install --index-url http://custompypi/ mypackage

does not work as pandas can't obviously be found.

pip install --index-url http://pypiproxy/ --extra-index-url http://custompypi/ mypackage

works until somebody uploads a package named mypackage on PyPi.

Closest I could come with is:

pip install --index-url http://custompypi/ --no-dependencies mypackage
pip install --index-url http://pypiproxy/ --extra-index-url http://custompypi/ mypackage

which does not feel right.

Any idea?



from Install specific package from specific index

No comments:

Post a Comment