I had this issue a while ago but was hoping that maybe with newer releases of Rhino it would get patched however I am still experiencing the same issue. I was using Rhino V8.9 previously with some python code which worked fine. I then updated Rhino to the latest version and now my script runs into errors. I went back and downloaded V8.9 and the same error exists. I then removed all files related to rhino/grasshopper/python and then installed rhino 8.9 again and now my script works. Seems that after V8.9 it changes files/setting which doesn’t allow my script to work in any version of rhino after V8.9? Any help would be much appreciated.
Below is a snippet of the code
import locale
locale.setlocale(locale.LC_ALL, 'en_US')
# r: comtypes==1.2.0
import comtypes.client
Then this is the error I am receiving:
Traceback (most recent call last):
File "rhinocode:///grasshopper/1/0fb3a042-a4d2-434a-bf76-0cd5bcf87d1f/a54b8394-d183-47ef-b006-c7e7a8cf1561", line 6, in <module>
File "C:\Users\dgoosen\.rhinocode\py39-rh8\site-envs\default-7V6xfHSC\comtypes\__init__.py", line 5, in <module>
from ctypes import *
File "C:\Users\dgoosen\.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)