Python Forum

Full Version: Pip question
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Not homework but n00b enough for it to be.

Working with Debian Buster, loaded with system python and Pypi packages. Slowly updating it via Pypi as doing it through the repo would be a nightmare. Planning on sticking on Buster and avoiding repo updates as long as possible.

So....
Updating/acquiring with a script like this:
pip install  --no-cache --upgrade-strategy=eager -r requirements.txt -c constraints.txt --index-url=https://pypi.python.org/simple/ --trusted-host=pypi.python.org
Works, but if it conflicts with a system python file will exit.

I can have it parse requirements.txt line by line with:
cat requirements.txt | while read PACKAGE; do pip install --no-cache -U --upgrade-strategy=eager -c constraints.txt --index-url=https://pypi.python.org/simple/ --trusted-host=pypi.python.org "$PACKAGE"; echo $?;  done
Works. BUT constraints.txt parsing becomes buggy. Sometimes it works, sometimes it doesnt.
Sometimes, for instance, it will ignore PyYAML, sometimes error, and at least once install anyway.

Is there something obvious that I am missing?

Also: Any clues as to how to go about parsing the error message and dumping the confllicting package name into constraints txt?
A partial solution is of course --user.
I dont really like hidden user dirs on a single user system/network, but a symlink fixed the inconvenience this might cause.

But... I've notice that my pyenv has the opposite order that I would expect (at least compared to perlenv):
user_site->pip.default_dist->system_dist

Which implies that system packages are parsed *last* in the series.
Personally I kind of like this arrangement, but is this how it actually works with python?