Update: I was wrong about the PyQt license. It isn't merely a GPL license. The PyQt authors include a special set of exceptions that allow users to release their own code under a different license, as long as it is one of the Open-Source licenses specifically listed in the PyQt GPL_EXCEPTION.TXT file.

For the purpose of this discussion, consider the following fully-functional app, which depends on PyQt:

# hello_world.py
from PyQt4.QtGui import QApplication, QPushButton
app = QApplication([])
button = QPushButton("Hello, World!", clicked=app.quit)

(In case it's relevant to the discussion, please note that Python programs like this one do not require "linking" per se.)

My preference is to distribute my code under a permissive license, e.g. the BSD license. However, PyQt is released under the GNU GPL GNU GPL with special exceptions. With that in mind, what are my options here? Am I obligated to release under the GPL, even if I don't distribute PyQt itself?

To be more specific, in which (if any) of the following scenarios am I permitted to release my code under the BSD license vs. being obligated to release under the GPL?

  • Scenario 1: I give you a fully-packaged binary that includes hello_world.py and PyQt.
  • Scenario 2: I give you the source code of hello_world.py and PyQt in a single download (say, a .tar.gz), but it's up to you to get them running together.
  • Scenario 3: I give you hello_world.py alone, leaving you to obtain PyQt on your own.

I know that most of us aren't lawyers, so it is very much appreciated if you can cite the sources your answer is based on.

2 Answers 2


Once GPL, Always GPL.

You can't distribute under the BSD if one of the libraries on which your application depends is licensed under GPL, nor can you close your source code.

Dual licensing using GPL and a commercial license is a common arrangement among vendors. It basically states that, if you want to use their library for a "true" open-source application (where you provide the entirety of the application's source code to the end-user, and let them do with it what they wish with it, so long as they also abide by the GPL) then you are welcome to use their library for that purpose. Otherwise, you can gain the right to close your source by buying a commercial copy of their license.

So the short answer is, so long as you are providing the source code to your application, all three scenarios should be OK. Your distribution license would be GPL, not BSD.

My citation is the GPL license.

  • 1
    Thanks for the response. However, I don't think the 3 scenarios in the question are all identical with respect to the GPL. In scenario 3, I'm proposing to distribute literally 5 lines of code, in source form, without PyQt. In my reading of the GPL, Scenario 3 allows for a BSD license. Commented Apr 10, 2014 at 17:32
  • 1
    If your code will not work without PyQT, you can't use BSD. That makes it a "combined work" under the GPL, and so requires it to be licensed under the GPL. Commented Apr 10, 2014 at 17:33
  • Can you be more specific about which section of the GPL requires me to license my code under the GPL even if I'm not redistributing the original library? Thanks again for helping me grok this legal stuff. :-) Commented Apr 10, 2014 at 17:35
  • Well, that's sort of the whole point of the GPL. Just saying "well, I just won't distribute the GPL'd portion, then I won't be bound by the GPL" doesn't work. It's not about distributing the other program; it's about making your program dependent on the GPL'd work. By doing that, you've already agreed to the GPL's terms. If you could get out of the obligations of the GPL by not distributing the GPL parts, that would pretty much invalidate the whole GPL license. Commented Apr 10, 2014 at 17:44
  • 1
    Robert, I had to unaccept this answer because my original question was factually inaccurate. My fault -- I've updated the question text now. I didn't notice that the PyQt license makes a specific exception that addresses my specific question. Regardless of what the "vanilla" GPL would allow in this case, I am definitely permitted to use a BSD license. Commented Apr 13, 2014 at 20:05

OK, this is easier than I thought. The PyQt folks didn't just release their software under the vanilla GPL. They added a special exception to the license, which allows me to release MY code under a non-GPL license. However, not all licenses are allowed: I must choose one of the open source licenses listed in the GPL_EXCEPTION.TXT file included with the PyQt source code. At the time of this writing, the exception permits me to use MIT, BSD, LGPL, and several others.

So, to address the specific scenarios outlined in the question above:

  • Scenario 1: GPL only
  • Scenario 2: GPL only
  • Scenario 3: Any license listed in GPL_EXCEPTION.TXT from the PyQt source distribution, including BSD.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.