How to use external libraries inside of a plugin
-
Hello!
I've been writing a plugin that takes some information in the form of API requests (with the third party library "Requests") but I was doing my testing inside of the Python Script Manager. It works fine this way - but when I try and do the same inside a CommandData plugin it says it can't find the "Requests" library when C4D gets loaded.
I've tried looking for this topic but I can't seem to find an anwser to it - apologies if this is a stupid question or if I just didn't look in the right place for it, as it seems something pretty basic but I can't get it to work
Any help would be much appreciated!
Thanks
-
Nevermind, i'm an idiot. All I had to do was place the lib in a folder in the plugin. Solved!
-
Hello @GillesKontrol,
thank you for reaching out to us. I am glad that you found your solution. When you are seeking an overview of the subject for future reference, I would recommend the Python Libraries manual in our documentation. It lines out the many ways in which dependencies can be exposed for a script or plugin.
Cheers,
Ferdinand -
Thankyou! Noted!