I am having a problem importing python libraries (e.g. pandas) into the script editor. Importing libraries produces the following error:
Traceback (most recent call last):
File "file:///C:/Users/tdowse/.rhinocode/stage/uxv3fscz.d5v", line 3, in <module>
File "C:\Users\tdowse\.rhinocode\py39-rh8\site-envs\default-J1ySvk2a\numpy\__init__.py", line 127, in <module>
_delvewheel_patch_1_5_2()
File "C:\Users\tdowse\.rhinocode\py39-rh8\site-envs\default-J1ySvk2a\numpy\__init__.py", line 106, in _delvewheel_patch_1_5_2
import ctypes
File "<frozen zipimport>", line 259, in load_module
File "ctypes\__init__.py", line 8, in <module>
ImportError: dynamic module does not define module export function (PyInit__ctypes)
Do you have a C:\Users\tdowse\.rhinocode\py39-rh8\python39.zip file? if yes, then delete the C:\Users\tdowse\.rhinocode\py39-rh8\Lib directory and relaunch Rhino to try again.
Also check the PYTHONPATH or PYTHONHOME under system environment variables in windows
@Thomas_Dowse Would you mind downloading 8.5RC and giving that a try? I need to make sure 8.5 has the same problem for you before I start making any changes to the runtime.
Also make sure you are not running any antivirus/security software that stops Rhino/python from loading the native libraries
@Thomas_Dowse Did my comment about accessing the python runtime help? I am curious to know what other customization options you want to provide to pip?
I am trying to see if we can make more improvements.
I have contacted my IT department and apparently we dont have access to Rhino 8.5. Will get them to investigate the antivirus suggestion and get back to you.
@Thomas_Dowse I did a series of changes in Rhino 8.6 to see if this would resolve your problem with the python deployment. Do you have a machine that you can probably test this on?
Hi Ehsan, my IT department is in the process of confirming that our permissions/security protocols around software install is not impacting the use of the external modules. I’ll get back to you as soon as I hear back from them. Thanks, Tom.
Good news: IT found a security protocol blocking installation of external modules which is now fixed and numpy works as expect. Also, now have access to Rhino 8.5.
Bad news: Pandas (the module we use most commonly to manage data) is now failing under a new error. I have included the error message below.