Solution without adding sy.path.append(…) each time
- Run this in a Python node inside Grasshopper
import site
sps = site.getsitepackages()
for sp in sps:
print(sp)
The output should look something like this
C:\Users\x\.rhinocode\py39-rh8C:\Users\x\.rhinocode\py39-rh8\lib\site-packages
- Find the file named
distutils-precedence.pth
Open it with the editor of your choice, where you will find something like
import os; var = 'SETUPTOOLS_USE_DISTUTILS'; enabled = os.environ.get(var, 'stdlib') == 'local'; enabled and __import__('_distutils_hack').add_shim();
- Add this in the next line
import sys; sys.path.append(r"D:\proton\My files\grasshopper\python")
- Restart Rhino and verify
import sys
paths = sys.path
for path in paths:
print(path)
- Add your *.py Files
- Enjoy

