I'm currently developing a software in Python which is importing functions of libraries.

So I was asking myself: do the licenses of the libraries I use in my software apply to my code?

And if not, can I put a license on my code on my behalf?

The source code of the libraries isn't in my software.

For example I use :

1 Answer 1


You can license code that you own under any license you wish, no exceptions. Even if your code is just a patch, you own copyrights to that patch and therefore you may license it however you please.

However, some licenses, namely GPL (but also proprietary licenses), introduce some restrictions on distributing the binaries or other kinds of compilations. Some combinations may produce a result that is illegal to distribute (sometimes even use) together.

In your case, you may license your code under a permissive license like MIT, but if you, or someone else, will want do distribute a compilation, he will have to license a compilation under a GPLv3 license and deal with its requirements. And just as you can use more permissively licensed libraries in your GPL code, you may also choose to license individual files under a lesser license, while licensing your whole package under a more restrictive license.

Do note, that if you bundle a library in your package, this means you are distributing it, and you are only allowed to distribute it under terms of its license. Just referencing other library, or including scripts to install it doesn't qualify as distribution.

Note: I am not a lawyer, this isn't a legal advice, it may differ in your jurisdiction, but I tried to accurately describe the general consensus of the open source community.

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.