Distributing programs depending on third party modules.

T

Tina I

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
 
B

Bruno Desthuilliers

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
 
K

Kevin Walzer

Tina said:
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.
 
K

Kevin Walzer

Bruno said:
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.
 
B

Bruno Desthuilliers

Kevin Walzer a écrit :
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.
 
T

Tina I

Kevin said:
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
 
B

Bruno Desthuilliers

Kevin Walzer a écrit :
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.
 
D

David Boddie

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 ;-)
 
K

Kevin Walzer

Bruno said:
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.
 
K

Kevin Walzer

Tina said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top