GPL PyQt with LGPL Qt

July 4, 2009

UPD: Actually, it turned out that if you don’t want to mess with manual installation of PyQt from sources, and also don’t wish to make fixes in its code, there are easy to use Windows installers on official PyQt page (GPL only). For Python 2.6 it can be downloaded here. Installation process is smooth and runs without any problems. And it DOES work from the scratch with LGPL version of Qt, remaining GPL itself though.

While configuring environment for developing my CD/DVD burner I ran into an issue with PyQt licensing. From my experience and what I heard previously and read in Internet, I was sure that “free” version of PyQt can be used with the “free” version of Qt library. But despite the fact I have LGPL Qt 4.5.2 installed on my Windows machine, the PyQt script kept telling me that those two libraries have inconsistent licenses. The error message lacks details:

Error: This version of PyQt and the Desktop edition of Qt have incompatible licenses.

That seemed kind of strange to me, so I started a little investigation. I found the initial (I suppose so) request for LGPL version of PyQt: [PyQt] LGPL license. There’s a rather long discussion, even with participation of PyQt author – Phil Thompson, which resulted in nothing. The main thought is that Phill was going to consider – should or not there be PyQt under LGPL.

Since that post was a somewhat outdated, headed back to PyQt site to check current situation and read the following:

PyQt, unlike Qt, is not available under the LGPL.

That stroke me, since I’m not sure if Qt is distributed under GPL at all nowadays. The thoughts started crowding in my head – how to overcome this obstacle (in a good sence). But then finally I’ve read the section named “Compatibility with Qt licenses”:

The GPL version of PyQt can be used with both the LGPL and GPL versions of Qt.

So there should be no problem develop in GPL PyQt with LGPL Qt library. But the script was resilient – “licenses are different!”. And I decided to dig into installation script with IDLE debugger. It turned out that during initial configuration, PyQt detects my LGPL QT as “Desktop” version and its own – as “GPL”, consequently the comparison of these two fails.

At that moment I decided try to just comment out the fancy function checkLicenses() – and it worked out! Now, after 1,5 hours of investigation, I have a working version of GPL PyQt with LGPL Qt!

P.S. Perhaps, there’s some additional info about how to make GPL PyQt work with LGPL Qt – I don’t know, as I wasn’t able to find any. So I made a fix that I think is a problem with PyQt installation script relying on information found at official site. It’s perhaps an inappropriate method, and I discourage you from using it 😉

And, as it is stated in PyQt’s FAQ:

Riverbank is a product based software development company that depends on sales to fund PyQt’s continued development. […] An LGPL version of PyQt, while probably increasing the number of users, would result in a reduction in income and therefore our ability to fund future development.

So, no luck for us who wish to use PyQt under LGPL license.

To start with, I’ll describe the development environment I’ll use to create my CD/DVD burner. Work progress will commence on Windows platform, since that OS is the most familiar for me.

The tools I’ll use:

  • ActiveState Active Python 2.6. That package is de-facto a standard for Windows.
  • ActiveState Komodo Edit. This editor is nice choice for developing in Python on Windows, though not ideal. I like, that Komode Edit is able to compose sources into workspaces, just like Visual Studio does 🙂
  • Qt framework by Nokia for GUI. I’m in love with this library, and since it’s now redistributed under LGPL, my love have increased noticeably 🙂 I will use Qt 4.5.2.
  • PyQt – Python bindings for Qt. I’m not yet familiar with PyQt and hope to get into it during the development process.

When Windows version will be ready I’ll  move on other platforms, and the toolset will surely be changed. But the set of software I specified should be sufficient for the initial release.

In the next post I’ll post the rough mock-up of my CD/DVD burner.