Suppose I do the following:

I code out a very small python program (like no more than five hundred lines of code): I download relevant packages about PyQt5, opencv, numpy, math and matplotlib at anaconda using update commands. In the code, I import PyQt5 them to code out some interface and import other libraries to do some very basic commands (i.e. I do not make changes to the source code.) At the end of the day, I use PyInstaller to convert everything I coded to exe to sell it to someone else for a price.

If I want to keep everything legal, do I need any kind of license for what I am doing? If I do need license, which one(s) do I need? I am kind of lost in all kinds of licenses.

  • 1
    You wrote "Assume every library other than PyQt5 are open source and don't cause any problem." In fact, open source software does not cause any problem, as long as you comply with the terms of the license of each of the components you are using in your code. Without knowing which components and which licenses you are using it is impossible to answer your question. There is even the possibility that some of the OSS licenses are incompatible to each other and then your project would be doomed (in terms of OSS license compliance). May 2 at 10:13
  • I have updated the question to be more specific. @Martin_in_AUT
    – 温泽海
    May 2 at 13:01
  • 1
    Please help us out here and tell us what licenses PyQt5, opencv, numpy and matplotlib are available under. (And math if that's anything more than the Python standard library math module). May 2 at 13:11

2 Answers 2


If I want to keep everything legal, do I need any kind of license for what I am doing? If I do need license, which one(s) do I need?

Yes, to create and distribute a program that uses/is based upon work of others you need to have a copyright license from those others that allows you to do those things. Such a copyright license always has some strings attached to it, ranging from having to give attribution to the persons whose work you used to having to make your work open-source or having to pay money for the license.

PyQt5 comes with two licensing options:

  • GPLv3, which costs no money but requires that you distribute your software under the same terms. Those terms include that recipients are allowed to make changes and to redistribute the software (with or without changes).
  • Commercial licenses, which do cost money but in return allow you to keep your own code private

The other packages you mentioned are available under permissive open-source licenses, that don't put restrictions on the licenses you can choose for your own code. They mainly require that you include a copy of the license with your software or documentation.


The licenses for the packages you mentioned (I am assuming you are using always the latest available version and PyQt5 will be used under the free license) in the question are the Apache License, the PSF License and GPLv3. The one with the strongest restrictions appears to be GPLv3, and the other licenses are compatible with it.

According to GPLv3 you will have to put your entire software under the GPLv3 license, which means that among a few other things you will have to provide the complete source code to the recipients/customers of your executable. Please read the entire license language to be sure that you comply with all of the requirements.

Your Answer

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

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