I have created a python package with several files and directories out of which only one particular module requires a library (PyQt) with GPL license. Since GPL license of the used library puts a restriction on the program to have same license. I was wondering if I can have separate license for other files of the package?

  • 1
    Note that while PyQt is GPL (or you can buy a commercial license), PySide/Python for Qt is LGPL. Consider porting your project to PySide/Python for Qt and you can avoid this issue entirely. Normally, there are only minor things (if any) that you would have to change. For example in PyQt there is a Python version of QString defined that acts like Qt's QString. In PySide they generally str (Python strings) instead. So if you depended on QString in your code, you would have to code around that; if you didn't, then maybe no change would be required. – Brandin Dec 11 '19 at 11:35

The GPL license on the library does not strictly imply that you must use the GPL license on the program. The GPL license requires that the rights that users get under the GPL license are extended to all code in the application, but that can also be achieved by using a GPL-compatible open-source license.

Additionally, the GPL license requires that you inform recipients that the terms of the GPL apply.

As long as you inform the recipients of your program that the GPL terms apply due to and as long as there is a dependency on PyQt, you can use a dual license (with one of the licenses being GPL compatible), or even a single GPL-compatible license for your own code.


A GPL-licensed library requires that any programme making use of it is also distributed under the GPL. However a GPL-licensed programme does not require that all libraries (or modules) it uses are also GPL-licensed. The modules can be under GPL or other licenses which are more permissive (like BSD, Apache, LGPL etc).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy