3

While there exists package managers for Python (pip and conda).

I was interested to know if there are package managers intended to be used from within Python (as Python module).

The reason I'm asking is that we have a graphical application where users would like to be able to install and update extensions (similar to firefox or chrome extensions). Where existing solutions are aimed at developers using the command-line and likely too technical.

Having said that, library access to pip could work too (and we can maintain a pip mirror), as long as there are ways to hook in GUI access, (progress bar, reporting if something fails).

We can always write our own, but this may be a solved problem. Are there any existing Python modules that generalize package management for end user applications take advantage of?


Note of clarification, since pip can be imported from Python, however as I understand it, pip assumes command line interaction (contains call to raw_input). Of course with monkey-patching in own code these things can be worked around (remap raw_input to dialog box for example), but at some point when too many workaround are needed, it may be better to use/write an alternative.

ideasman42
  • 42,413
  • 44
  • 197
  • 320
  • 1
    `>>> import pip` might get you started – Joran Beasley Nov 20 '15 at 00:37
  • possible duplicate http://stackoverflow.com/questions/12332975/installing-python-module-within-code – Joran Beasley Nov 20 '15 at 00:38
  • Yes, am aware of the ability to import pip and saw the question, but as far as I can tell this is similar to wrapping a command line tool. For eg, I want to use my own progress bar - as simple example. – ideasman42 Nov 20 '15 at 00:47
  • thats why I didnt close it as dupe but only posted as a possible dupe...I dont think this is a solved problem ... but you could probably use pip to find the url to download and use urllib or requests to download and provide % feedback – Joran Beasley Nov 20 '15 at 00:54
  • you may want to look at the `esky` package but you will probably have to do some amount customization – Joran Beasley Nov 20 '15 at 00:57
  • Are there examples of `pip` being successfully wrapped with a gui? And - `esky` looks promising, even if its just as a reference. – ideasman42 Nov 20 '15 at 00:59
  • I dont think so ... its gonna be painful ... I would either provide your images as esky packages and use esky or write your own thing or give up on progress bars and use status text (which you can parse from pip easily) – Joran Beasley Nov 20 '15 at 01:02
  • 1
    The issue isn't just about needing a progress bar in a GUI, thats an example of something with a Python package manager might be able to do, its more that the state of the package manager should be able to be communicated as it runs *(not some sub-process which leave the user in an unknown state until its finished)*. – ideasman42 Nov 20 '15 at 03:43

0 Answers0