Access Python files within a library in a project

Hello everyone,

I’m encountering an issue when creating a package of my Python scripts in Rhino 8 . I have a Command calling a main.py file in the Library folder like this “from lib import filename1” and its working but the file i am Calling is calling other files in the Library and when i try to access them i get an error :“ModuleNotFoundError: No module named ‘filename2’”.
I do have an init.py file in my Library folder.
How can i access those files from within my python Library?

@eirannejad Do you know any ways to do this ? or is it even possible ?

Usually you can reference relative files inside of your python library using from . import function. It would be great if you can share an example if what the library looks like

1 Like