Congyuwang / RocksDict

Python fast on-disk dictionary / RocksDB & SpeeDB Python binding
https://congyuwang.github.io/RocksDict/rocksdict.html
MIT License
176 stars 8 forks source link

latest wheel does not work on apple sillon #25

Closed numb3r3 closed 1 year ago

numb3r3 commented 1 year ago

This is the error log I got:

 from rocksdict import Options, Rdict, ReadOptions, WriteBatch, WriteOptions
../../../.pyenv/versions/3.8.6/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rocksdict/__init__.py:1: in <module>
    from .rocksdict import *
E   ImportError: dlopen(/Users/fengwang/.pyenv/versions/3.8.6/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rocksdict/rocksdict.cpython-38-darwin.so, 2): Symbol not found: __ZNKSt3__115basic_stringbufIcNS_11char_traitsIcEENS_9allocatorIcEEE3strEv
E     Referenced from: /Users/fengwang/.pyenv/versions/3.8.6/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/rocksdict/rocksdict.cpython-38-darwin.so (which was built for Mac OS X 12.0)
E     Expected in: /usr/lib/libc++.1.dylib

The uname -a yield:

 uname -a
Darwin Fengs-MacBook-Pro.local 20.3.0 Darwin Kernel Version 20.3.0: Thu Jan 21 00:06:51 PST 2021; root:xnu-7195.81.3~1/RELEASE_ARM64_T8101 x86_64

The pip install -U rocksdict yield:

Collecting rocksdict
  Downloading rocksdict-0.3.0-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl (6.4 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.4/6.4 MB 16.2 MB/s eta 0:00:00
Installing collected packages: rocksdict
  Attempting uninstall: rocksdict
    Found existing installation: rocksdict 0.2.16
    Uninstalling rocksdict-0.2.16:
      Successfully uninstalled rocksdict-0.2.16
Successfully installed rocksdict-0.3.0
Congyuwang commented 1 year ago

Hi. look at the hint which says '(which was built for Mac OS X 12.0)'. It seems you are using 11.3.

Congyuwang commented 1 year ago

You can try to build the wheel from source code using maturin build --release and then pip install. This problem seems to be caused by the newer MacOS version (macOS-12) on GitHub Action. I'll see if I can use macOS-11, and do a patch.

Congyuwang commented 1 year ago

26

Congyuwang commented 1 year ago

You may try v0.3.1.

numb3r3 commented 1 year ago

Thanks for your quick fix. It works now, you rock.

numb3r3 commented 1 year ago

BTW, you should also yank the v0.3.0 as well. This release is still available on pypi.

Congyuwang commented 1 year ago

yanked

Congyuwang commented 1 year ago

Got a new feature in v0.3.3. Reopening Rdict now does not require providing columnFamily names or their options. Rdict now loads the latest Options from db path (although manually providing Options overrides it).