I had a similar problem when trying to use grafica in a class.
For some reason it works, when i import the library in the python style:
add_library(grafica)
import grafica as g
Then referring to all objects with g. and so on.
However, if i do that once and then delete the first line it works. If i close the sketch and reload it doesn’t. Looks like the library is only installed at runtime??
Strange.