Using a python library for defold scripts

Let’s say i have an AI library that i wrote in python, it has classes with functions and variables, and i need to use it to control game objects in my game.

How could i do this? I was thinking on maybe using something like Lunatic Python, but i don’t know how to even install it so that it works with Defold scripts.

Trying to get python to work well in a game engine that doesn’t natively support it will not work well enough. You may be able to find a way to run the python code but the performance will really suffer. Either you port the code to Lua, switch to a python game engine or find another AI library.