Licensing Differences Between PyQt5 and PySide2

Understanding GPL, LGPL, and what they mean for your Python GUI projects
Heads up! You've already completed this tutorial.

If you're getting started with Python GUI development, you've probably noticed there are two main bindings for the Qt framework: PyQt5 and PySide2. The APIs are almost identical, so a natural question comes up — when should you use PyQt5 and when is PySide2 the better choice?

This is a great question, and understanding the answer will help you make a confident choice for your own projects.

The Licenses at a Glance

PyQt5 is available under the GNU GPL v3 license, or under a commercial license from Riverbank Computing (the developers of PyQt5). If you want to use PyQt5 without following the terms of the GPL, you need to purchase a commercial license.

PySide2 is available under the LGPL v3 license. The LGPL is more permissive than the GPL, which gives you more flexibility when distributing proprietary or closed-source software.

Both the GPL and the LGPL are open source licenses, but they come with different obligations — and that difference matters depending on what you're building.

What Does the GPL Require?

The GPL (GNU General Public License) is a copyleft license. If you distribute software that uses a GPL-licensed library, your entire application must also be released under the GPL. In practice, this means:

  • You must make your source code available to anyone who receives your software.
  • You cannot distribute your application under a proprietary or closed-source license.

For open source projects, academic research software, or internal tools that you don't distribute, this is perfectly fine. The GPL only applies when you distribute the software to others.

What Does the LGPL Require?

The LGPL (Lesser General Public License) is less restrictive. You can use an LGPL-licensed library in a proprietary application, as long as you:

  • Dynamically link to the LGPL library (rather than statically bundling it into your binary). In practice, Python applications naturally do this because they import PySide2 as a separate package.
  • Provide a way for users to replace or modify the LGPL-licensed component. Since PySide2 is installed as a standard Python package, users can update or replace it themselves.
  • Include a copy of the LGPL license with your distribution and make it clear which parts of your application are covered by it.
  • Provide access to the LGPL source code (for PySide2 itself, not your own application code).

You do not need to open-source your own application code.

Given the licensing difference, it might seem like PySide2 is the obvious choice. But there are several reasons why PyQt5 has remained popular:

PyQt5 came first

PyQt5 had its initial release in 2016, while PySide2 didn't arrive until 2018 — and its early releases had quite a few bugs. By the time PySide2 matured, PyQt5 already had a large user base, extensive community support, and widespread adoption. That momentum built up over years, and many tutorials, Stack Overflow answers, and third-party tools were written with PyQt5 in mind.

The GPL isn't always a problem

For many use cases, the GPL's requirements are a non-issue. If you're building open source software, academic tools, or internal applications that never get distributed, the GPL places no meaningful restrictions on you. Open source licenses are standard in research and scientific computing, for example.

Commercial licenses offer support

Some companies may prefer paying for a commercial PyQt5 license. In exchange, they get direct support from Riverbank Computing and the freedom to use their own proprietary license. For businesses, a paid license with support can be more attractive than a free-but-unsupported option.

Minor API differences

While PyQt5 and PySide2 are very similar, there are small differences in how they handle certain things. For instance, PyQt5 has a slightly different (and some would say more convenient) approach to loading .ui files created in Qt Designer. These differences are minor, but developers who are already comfortable with one framework tend to stick with it.

Which Should You Choose?

For most new projects, the practical differences between PyQt5 and PySide2 are small. Here's a simple way to think about it:

Consideration PyQt5 PySide2
License GPL v3 (or commercial) LGPL v3
Open source projects Yes Yes
Closed-source / commercial Requires paid license Free under LGPL terms
Community & resources Large, established Growing, well-supported
Backed by Riverbank Computing The Qt Company

If you're building something open source, either one works well. If you're planning to distribute closed-source commercial software and don't want to pay for a license, PySide2 gives you that flexibility under the LGPL. If you want commercial support, PyQt5 may be the better choice.

The good news is that switching between them is straightforward. The APIs are nearly identical, and most code can be converted from one to the other with only minor changes. For a detailed comparison, take a look at our guide on the differences between PyQt5 and PySide2.

The best approach? Try both, and convert a small project from one to the other. You'll quickly see how similar they are — and you'll feel confident that whichever you choose, you're not locked in.

Well done, you've finished this tutorial! Mark As Complete
[[ user.completed.length ]] completed [[ user.streak+1 ]] day streak

Create GUI Applications with Python & Qt6 by Martin Fitzpatrick

(PySide6 Edition) The hands-on guide to making apps with Python — Over 15,000 copies sold!

More info Get the book

Martin Fitzpatrick

Licensing Differences Between PyQt5 and PySide2 was written by Martin Fitzpatrick.

Martin Fitzpatrick has been developing Python/Qt apps for 8 years. Building desktop applications to make data-analysis tools more user-friendly, Python was the obvious choice. Starting with Tk, later moving to wxWidgets and finally adopting PyQt. Martin founded PythonGUIs to provide easy to follow GUI programming tutorials to the Python community. He has written a number of popular Python books on the subject.