objectbox / objectbox-python

Superfast on-device object & vector database for Python
https://objectbox.io/
Apache License 2.0
129 stars 19 forks source link

Not working on Mac with apple silicon #8

Closed huluwa-dev closed 3 years ago

huluwa-dev commented 3 years ago

Hi, first of all, thank you for your great work. Recently I used this library on my M1 Mac, but I got error below:

Traceback (most recent call last): File "/Users/ke/Dev/python/projects/temp/sqlite3_2_objectbox.py", line 4, in import objectbox File "/Users/ke/Dev/python/projects/temp/venv/lib/python3.8/site-packages/objectbox/init.py", line 16, in from objectbox.box import Box File "/Users/ke/Dev/python/projects/temp/venv/lib/python3.8/site-packages/objectbox/box.py", line 16, in from objectbox.model.entity import _Entity File "/Users/ke/Dev/python/projects/temp/venv/lib/python3.8/site-packages/objectbox/model/init.py", line 16, in from objectbox.model.entity import File "/Users/ke/Dev/python/projects/temp/venv/lib/python3.8/site-packages/objectbox/model/entity.py", line 17, in from objectbox.c import File "/Users/ke/Dev/python/projects/temp/venv/lib/python3.8/site-packages/objectbox/c.py", line 45, in C = ctypes.CDLL(lib_path) File "/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/ctypes/init.py", line 365, in init self._handle = _dlopen(self._name, mode) OSError: dlopen(/Users/ke/Dev/python/projects/temp/venv/lib/python3.8/site-packages/objectbox/lib/arm64/libobjectbox.dylib, 6): image not found

Any solution for this?

vaind commented 3 years ago

The objectbox-c (native library) version currently used by the python binding doesn't support M1. Python binding needs to be updated to the latest version. Unless you want to do that :), I'll try to have a look next week.

vaind commented 3 years ago

Should work with the latest version (v0.3.0). pip install --upgrade objectbox