Python Module Import Error Ctypes

Hi,

I just updated Rhino 8 and am now getting the following errors:

Traceback (most recent call last):
  File "rhinocode:///grasshopper/1/f64bbba1-4cc5-4d01-9321-282162eefd29/ea314ee9-22d6-49d3-b80a-54c808d95437", line 7, in <module>
  File "C:\Users\mgoodwin\.rhinocode\py39-rh8\site-envs\default-_WdkyJG1\comtypes\__init__.py", line 5, in <module>
    from ctypes import *
  File "C:\Users\mgoodwin\.rhinocode\py39-rh8\lib\ctypes\__init__.py", line 8, in <module>
    from _ctypes import Union, Structure, Array
ImportError: dynamic module does not define module export function (PyInit__ctypes)

Any ideas on how to fix this?


Thanks,
Miles

Hello @Miles_Goodwin

Welcome to the community. What Rhino version are you running? (Share SystemInfo command report if you can)

Use the menu item shown below to reset the Python 3 runtime and run the script below to see if the error persists. You would want to restart Rhino after resetting the runtime:

#! python3
from _ctypes import Union, Structure, Array
print(Union, Structure, Array)