Import rhino in python

I’m on M2 MacBook Air and cannot import rhino and get the following error. Is this not available on rhino?

/Users/ramazanmengi/anaconda3/envs/yacht_designer/bin/python /Users/ramazanmengi/PycharmProjects/yacht_designer/a.py
Traceback (most recent call last):
File “/Users/ramazanmengi/PycharmProjects/yacht_designer/a.py”, line 1, in
import rhino3dm as rh
File “/Users/ramazanmengi/anaconda3/envs/yacht_designer/lib/python3.11/site-packages/rhino3dm/init.py”, line 5, in
from ._rhino3dm import *
ImportError: dlopen(/Users/ramazanmengi/anaconda3/envs/yacht_designer/lib/python3.11/site-packages/rhino3dm/_rhino3dm.cpython-311-darwin.so, 0x0002): tried: ‘/Users/ramazanmengi/anaconda3/envs/yacht_designer/lib/python3.11/site-packages/rhino3dm/_rhino3dm.cpython-311-darwin.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’)), ‘/System/Volumes/Preboot/Cryptexes/OS/Users/ramazanmengi/anaconda3/envs/yacht_designer/lib/python3.11/site-packages/rhino3dm/_rhino3dm.cpython-311-darwin.so’ (no such file), ‘/Users/ramazanmengi/anaconda3/envs/yacht_designer/lib/python3.11/site-packages/rhino3dm/_rhino3dm.cpython-311-darwin.so’ (mach-o file, but is an incompatible architecture (have ‘x86_64’, need ‘arm64’))

Process finished with exit code 1

1 Like

This is the critical error. Perhaps @eirannejad can help.

@Ramazan_Mengi Using rhino3dm inside Rhino Python 3 is not supporte yet. As you might have noticed it is a cpython c module built against _rhino3dm.cpython-311-darwin.so for CPython 3.11 and also a modified version of Rhino core api. We will support this in the future for performance reasons though.

Also having this issue. @Ramazan_Mengi did you find a workaround?