Has anyone encountered this python error? My code runs fine on the system through VS Code but when I try to run it in a GH python3 block I get this error.
I think I need to fix my python paths but im not sure and I cant figure out how.
I ran this code from the GH python3 block and my system seperatley.
import sys
print(“Python executable:”, sys.executable)
print(“Python path:”, sys.path)
GH output:
Python executable: C:\Program Files\Rhino 8\System\Rhino.exe
Python path: [‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8\site-envs\default-NnkO2Bxf’, ‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8\site-rhinoghpython’, ‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8\site-rhinopython’, ‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8\site-interop’, ‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8\python39.zip’, ‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8\DLLs’, ‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8\lib’, ‘C:\Program Files\Rhino 8\System’, ‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8’, ‘C:\Users\xxxxxxxx\.rhinocode\py39-rh8\lib\site-packages’, ‘C:\Windows\Microsoft.NET\Framework64\v4.0.30319\’]
System output:
import sys
print(“Python executable:”, sys.executable)
Python executable: C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312\python.exe
print(“Python path:”, sys.path)
Python path: [‘’, ‘C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312\python312.zip’, ‘C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312\DLLs’, ‘C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312\Lib’, ‘C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312’, ‘C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages’, ‘C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\win32’, ‘C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\win32\lib’, ‘C:\Users\xxxxxxxx\AppData\Local\Programs\Python\Python312\Lib\site-packages\Pythonwin’]