I have a custom Python package/module with the following file structure:
init.py contains imports for
lib2. lib1 contains a class, as does lib2.
In Grasshopper, I add the absolute path of the package directory to
sys.path, since it’s currently not located inside the default Rhino scripts folder.
import sys if "absolute/path/package" not in sys.path: sys.path.append("absolute/path/package") import package # works fine!
As already indicated above, I’ve outsourced the importing of modules - like
random, etc. - that I use frequently in both lib1.py and lib2.py, to
However, when I call classes and their methods in GHPython from lib1.py and lib2.py, I get errors, like
global name 'os' is not defined, although I
import os in
I’ve also noticed that no Python cache files (.pyc) get created, when I
import package in GHPython?
Any ideas what I’m missing here?