Distributing programs depending on third party modules.

Discussion in 'Python' started by Tina I, May 15, 2007.

  1. Tina I

    Tina I Guest

    Hi list,

    Is there a preferred way to distribute programs that depends on third
    party modules like PyQt, Beautifulsoup etc? I have used setuptools and
    just having the setup script check for the existence of the required
    modules. If they're not found I have it exit with a message that it need
    this or that installed.

    But this is not very convenient for the end user and I have got a few
    complaints about it. Am I missing something in setuptools or is there a
    better way to do it (except for bundling the modules in the package
    which seem like a rather nasty workaround)?

    Thanks
    Tina
     
    Tina I, May 15, 2007
    #1
    1. Advertising

  2. Tina I a écrit :
    > Hi list,
    >
    > Is there a preferred way to distribute programs that depends on third
    > party modules like PyQt, Beautifulsoup etc? I have used setuptools and
    > just having the setup script check for the existence of the required
    > modules. If they're not found I have it exit with a message that it need
    > this or that installed.
    >
    > But this is not very convenient for the end user and I have got a few
    > complaints about it. Am I missing something in setuptools


    EasyInstall, perhaps ?
    http://peak.telecommunity.com/DevCenter/EasyInstall

    HTH
     
    Bruno Desthuilliers, May 15, 2007
    #2
    1. Advertising

  3. Tina I

    Kevin Walzer Guest

    Tina I wrote:
    > Hi list,
    >
    > Is there a preferred way to distribute programs that depends on third
    > party modules like PyQt, Beautifulsoup etc? I have used setuptools and
    > just having the setup script check for the existence of the required
    > modules. If they're not found I have it exit with a message that it need
    > this or that installed.
    >
    > But this is not very convenient for the end user and I have got a few
    > complaints about it. Am I missing something in setuptools or is there a
    > better way to do it (except for bundling the modules in the package
    > which seem like a rather nasty workaround)?
    >
    > Thanks
    > Tina


    What platform are you doing this on? On the Linux platform, "dependency
    hell" of this sort is pretty much unavoidable, because there are so many
    different packaging systems (apt, rpm, and so on): it's standard to let
    the package manager handle these dependencies. And yes, it is
    frustrating for end users.

    On Windows and the Mac, bundling all the modules isn't a "nasty
    workaround"; it's the standard behavior. End users on those platforms
    expect complete application packages, including all supporting
    libraries, to be provided by the developers. The standard tools for
    doing this are py2exe for Windows (http://www.py2exe.org/) and py2app
    for Mac (http://svn.pythonmac.org/py2app/py2app/trunk/doc/index.html).

    There are other methods for distributing "frozen binaries," including
    the freeze module that ships with Python itself, cx_freeze, and
    PyInstaller: these three may work on Linux/Unix as well as Windows (they
    are not supported on the Mac). But the methods above are generally the
    ones most widely used.

    --
    Kevin Walzer
    Code by Kevin
    http://www.codebykevin.com
     
    Kevin Walzer, May 15, 2007
    #3
  4. Tina I

    Kevin Walzer Guest

    Bruno Desthuilliers wrote:

    >> What platform are you doing this on? On the Linux platform,
    >> "dependency hell" of this sort is pretty much unavoidable,

    >
    > Yes it is. EasyInstall works just fine.


    You can install a beast like PyQt with easy_install? Meaning, that it
    will download and build/install not just the PyQt bits, but also Qt
    itself, sip, and all the other foundational components? If easy_install
    handles all that, I'm impressed.
    --
    Kevin Walzer
    Code by Kevin
    http://www.codebykevin.com
     
    Kevin Walzer, May 15, 2007
    #4
  5. Kevin Walzer a écrit :
    > Tina I wrote:
    >
    >> Hi list,
    >>
    >> Is there a preferred way to distribute programs that depends on third
    >> party modules like PyQt, Beautifulsoup etc? I have used setuptools and
    >> just having the setup script check for the existence of the required
    >> modules. If they're not found I have it exit with a message that it
    >> need this or that installed.
    >>
    >> But this is not very convenient for the end user and I have got a few
    >> complaints about it. Am I missing something in setuptools or is there
    >> a better way to do it (except for bundling the modules in the package
    >> which seem like a rather nasty workaround)?
    >>
    >> Thanks
    >> Tina

    >
    >
    > What platform are you doing this on? On the Linux platform, "dependency
    > hell" of this sort is pretty much unavoidable,


    Yes it is. EasyInstall works just fine.

    > because there are so many
    > different packaging systems (apt, rpm, and so on): it's standard to let
    > the package manager handle these dependencies. And yes, it is
    > frustrating for end users.


    I'm a happy user of Gentoo and Ubuntu. I don't have any frustration
    feeling.
     
    Bruno Desthuilliers, May 15, 2007
    #5
  6. Tina I

    Tina I Guest

    Kevin Walzer wrote:
    >
    > What platform are you doing this on? On the Linux platform, "dependency
    > hell" of this sort is pretty much unavoidable, because there are so many
    > different packaging systems (apt, rpm, and so on): it's standard to let
    > the package manager handle these dependencies. And yes, it is
    > frustrating for end users.

    I mainly write apps for Linux although some are in theory cross platform
    (but I don't have Windows to test on so I don't really care about that
    part). Of course catering to every concievable package management system
    is impossible so I'm looking for something to make it easy for people to
    use the app as it is.
    >
    > There are other methods for distributing "frozen binaries," including
    > the freeze module that ships with Python itself, cx_freeze, and
    > PyInstaller: these three may work on Linux/Unix as well as Windows (they
    > are not supported on the Mac). But the methods above are generally the
    > ones most widely used.
    >

    A binary would be ideal. I'll look into the freeze modules and
    Pyinstaller. Even if they don't handle huge things like Qt it would be a
    step in the right direction if it handles smaller third part modules.
    And maybe the smartest thing to do would be to dump PyQt and just go for
    tkinter, however ugly it is :/

    Anyways, thanks for the help people
    Tina
     
    Tina I, May 16, 2007
    #6
  7. Kevin Walzer a écrit :
    > Bruno Desthuilliers wrote:
    >
    >>> What platform are you doing this on? On the Linux platform,
    >>> "dependency hell" of this sort is pretty much unavoidable,

    >>
    >> Yes it is. EasyInstall works just fine.

    >
    > You can install a beast like PyQt with easy_install? Meaning, that it
    > will download and build/install not just the PyQt bits, but also Qt
    > itself, sip, and all the other foundational components?


    Are these components packaged in such a way to support easy_install ?-)

    No, of course, easy_install doesn't *actually* support this (while
    AFAICT, it technically *could* do the job). I was talking about
    dependencies between Python packages.

    If you want support for such external dependencies, emerge
    (Gentoo-Linux) is your friend - and believe me, it's really impressive.

    Note that if you go that way, neither Windows nor MacOS X are actually
    able to cleanly manage such dependencies (which is why the usual
    solution on these platforms - or at least on Windows - is to just bundle
    everything in a single big package). FWIW, I sure had much more trouble
    with "DLHell" on Windows than on Gentoo or Ubuntu.

    > If easy_install
    > handles all that, I'm impressed.


    I'm already impressed by the whole setuptools package.
     
    Bruno Desthuilliers, May 16, 2007
    #7
  8. Tina I

    David Boddie Guest

    On May 16, 7:44 am, Tina I <> wrote:

    > A binary would be ideal. I'll look into the freeze modules and
    > Pyinstaller. Even if they don't handle huge things like Qt it would be a
    > step in the right direction if it handles smaller third part modules.
    > And maybe the smartest thing to do would be to dump PyQt and just
    > go for tkinter, however ugly it is :/


    It's may be worth reading this message before making such a drastic
    decision:

    http://www.riverbankcomputing.com/pipermail/pyqt/2007-May/016092.html

    David ;-)
     
    David Boddie, May 16, 2007
    #8
  9. Tina I

    Tina I Guest

    David Boddie wrote:
    > On May 16, 7:44 am, Tina I <> wrote:
    >
    >> A binary would be ideal. I'll look into the freeze modules and
    >> Pyinstaller. Even if they don't handle huge things like Qt it would be a
    >> step in the right direction if it handles smaller third part modules.
    >> And maybe the smartest thing to do would be to dump PyQt and just
    >> go for tkinter, however ugly it is :/

    >
    > It's may be worth reading this message before making such a drastic
    > decision:
    >
    > http://www.riverbankcomputing.com/pipermail/pyqt/2007-May/016092.html
    >
    > David ;-)
    >

    Oh... now I feel stupid... I'm on the PyQt list but somehow missed that
    topic.
    Thanks!

    Tina
     
    Tina I, May 16, 2007
    #9
  10. Tina I

    Kevin Walzer Guest

    Bruno Desthuilliers wrote:
    > Kevin Walzer a écrit :
    >
    > Note that if you go that way, neither Windows nor MacOS X are actually
    > able to cleanly manage such dependencies (which is why the usual
    > solution on these platforms - or at least on Windows - is to just bundle
    > everything in a single big package). FWIW, I sure had much more trouble
    > with "DLHell" on Windows than on Gentoo or Ubuntu.


    I target Mac OS X only with my Python application. py2app wraps up
    Python, Tcl/Tk, and the related items into a single application bundle,
    which the user can then install via drag-and-drop. The resulting package
    is big, but hard drive space is cheap these days.

    >
    > I'm already impressed by the whole setuptools package.
    >


    In general, I agree with this statement. It's very simple to do sudo
    easy_install mypythonextension--even easier than grabbing a tarball
    myself and doing python setup.py, because it downloads the bits for you.

    --
    Kevin Walzer
    Code by Kevin
    http://www.codebykevin.com
     
    Kevin Walzer, May 16, 2007
    #10
  11. Tina I

    Kevin Walzer Guest

    Tina I wrote:
    > Kevin Walzer wrote:



    > And maybe the smartest thing to do would be to dump PyQt and just go for
    > tkinter, however ugly it is :/


    Tkinter doesn't have to be ugly.

    I sell a proprietary Tkinter app commercially on OS X:

    http://www.codebykevin.com/phynchronicity-running.png

    It takes some work to get Tkinter looking polished. You have to use
    extension packages for things like table views, tree views,
    platform-specific theming, and so on. Fortunately, all that stuff is
    available in Tkinter:

    Tile for Tkinter: http://tkinter.unpythonic.net/wiki/TileWrapper

    Tabelist for Tkinter (with Tile support):
    http://tkinter.unpythonic.net/wiki/TableListTileWrapper

    pyBwidgets: http://tkinter.unpythonic.net/bwidget/

    Tile, Tablelist and BWidgets are my extension packages of choice. There
    are others as well.

    Here's a sample application that uses some of the packages outlined above:

    http://tkinter.unpythonic.net/wiki/PyLocateTile (includes Mac and
    X11-based screen shots)

    It may not be worth your time to port from PyQt to Tkinter, but I did
    want to show a bit how you can create a polished GUI with Tkinter.

    --
    Kevin Walzer
    Code by Kevin
    http://www.codebykevin.com
     
    Kevin Walzer, May 16, 2007
    #11
  12. Tina I

    Tina I Guest

    Kevin Walzer wrote:
    > Tina I wrote:
    >> Kevin Walzer wrote:

    >
    >
    >> And maybe the smartest thing to do would be to dump PyQt and just go
    >> for tkinter, however ugly it is :/

    >
    > Tkinter doesn't have to be ugly.
    >
    > I sell a proprietary Tkinter app commercially on OS X:
    >
    > http://www.codebykevin.com/phynchronicity-running.png
    >


    Thanks, looks very nice :)
    I'll play around with Tkinter a little and maybe try it out for my next
    project just for fun.

    Tina
     
    Tina I, May 17, 2007
    #12
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Andrew Makhorin

    using third-party dll in java programs

    Andrew Makhorin, Nov 24, 2003, in forum: Java
    Replies:
    2
    Views:
    581
  2. Sibylle Koczian
    Replies:
    4
    Views:
    526
    Sibylle Koczian
    Jan 25, 2005
  3. Ben Finney
    Replies:
    6
    Views:
    304
    Serge Orlov
    Jun 15, 2006
  4. eliben
    Replies:
    9
    Views:
    351
    eliben
    Jun 9, 2008
  5. Brock

    Third Party Modules

    Brock, Apr 28, 2009, in forum: Python
    Replies:
    7
    Views:
    312
    David Lyon
    Apr 29, 2009
Loading...

Share This Page