6

So, I made a program with Pygame and PySimpleGui, both licensed under LGPL. I didn´t modified them, just imported and used them on my code. Well, I heard somewhere that GPL 2 is not compatible with GPL 3, and the problem is: Pygame, according to this file, is on the version 2.1 of LGPL license, and PySimpleGUI, according to this file, is licensed under LGPL 3.0. I know LGPL is more open than GPL, but can I use them in the same file of code?

4
  • When you say "in the same file of code", it's potentially a bit confusing. Do you mean the same source file, e.g. in a single .py file? Based on what you wrote here and elsewhere, I suspect you actually might mean "in the same program". E.g. some files are LGPL 2.1, some files are LGPL 3.0, and your own code files are under some other license. If you know what license you want your own code files to be under (e.g. GPL 3), it may be easier if you mention that as well. So, could you consider clarifying these specifics in your question? It will make the answer easier and more useful.
    – Brandin
    Oct 27, 2022 at 9:01
  • @Brandin I want to put them under the same source file, in a single .py file. And I actually don´t know yet what license I'll put my program under, but probably LGPL, GPL or MIT. But this is important? I mean, I'm using two LGPL libraries, so doesn't matter what license I'm using, or it matter? I'm not so good in licensing terms, so I really don't know Oct 27, 2022 at 18:27
  • 1
    If you want to combine an LGPL library into the same source file then basically you can see that as an extension of the library. So, it means that your overall program probably must have the same license (LGPL). Perhaps you could also relicense the whole thing as GPL, but I'm not sure at the moment. I'd recommend you clarify your question and give these specifics so you can get a more precise Answer.
    – Brandin
    Oct 28, 2022 at 4:26
  • 1
    The normal way LGPL libraries are meant to be used is that they remain separate from your main program. If you use them in that way, then you are generally free to license your main program as you wish.
    – Brandin
    Oct 28, 2022 at 4:27

1 Answer 1

6

If both are libraries - one licensed under LGPLv2.1 and the other licensed under LGPLv3 - and both are used by your software as a library (i.e. your software is a "work that uses the library"), and your software is not a "work based on the library", then the licenses of those libraries do not apply in a viral way to your software, and to each other.

However, any modifications to the LGPL-licensed library, or any "work based on the library" would automatically be licensed under the same license as the library.

Also, any dependency of those libraries need to have a compatible license with the license of those libraries.

In addition, please note that pygame's license header in the comments of source files (like this one) imply that it is licensed under LGPLv2.1-or-later. So, it may be compatible with LGPLv3 anyway.

The file colordict.py states:

#    pygame - Python Game Library
#    Copyright (C) 2000-2003  Pete Shinners
#
#    This library is free software; you can redistribute it and/or
#    modify it under the terms of the GNU Library General Public
#    License as published by the Free Software Foundation; either
#    version 2 of the License, or (at your option) any later version.
#

However, the README file does not state this explicitly.

15
  • 1
    The note in that file is a bit contradictory, because in github.com/pygame/pygame/blob/main/README.rst it says instead "LGPL 2.1" and "We reserve the right to place future versions of this library under a different license". However, in any case, since we're talking about LGPL here, why is it even necessary to upgrade the license of Pygame from LGPL 2.1 to LGPL 3.0? I think the license compatibility problem would only come up if we're trying to combine two different GPL codebases (e.g. GPL 2.1 and GPL3) into a bigger (say) GPL3 codebase.
    – Brandin
    Oct 27, 2022 at 9:10
  • 1
    @Brandin That's right. As long as the two libraries are independent from each other, the licenses don't affect the other.
    – ruben2020
    Oct 27, 2022 at 9:15
  • 1
    In your answer the phrase "[if] your software is not a derivative work of those libraries" but that's potentially a bit confusing. In the LGPL 2.1 preamble, for example, it is explained that legally speaking, linking a library (even an LGPL one) to your program does indeed create a derivative work, since your program includes portions of the library. However, the LGPL (both versions) give you permission to do this "under terms of your choice", as long as you follow certain requirements, like allowing the end-user to replace your version of those LGPL libraries with a different version.
    – Brandin
    Oct 27, 2022 at 9:23
  • 1
    @Brandin I will reword it. I meant in this context, from the preamble: 'The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run.'
    – ruben2020
    Oct 27, 2022 at 9:39
  • 1
    Section 5 defines a "work that uses the library" as "a program that contains no derivative of any portion of the library." For this concrete example, it would correspond to the case where I release a program but rather than including Pygame and PySimpleGUI along with my program, I ask the end users to go download and install Pygame and PySimpleGUI themselves before they can run my program.
    – Brandin
    Oct 27, 2022 at 9:45

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.