wbolster / plyvel

Plyvel, a fast and feature-rich Python interface to LevelDB
https://plyvel.readthedocs.io/
Other
518 stars 75 forks source link

Plyvel not linked correctly to `leveldb` in MacOS #134

Open julianmrodri opened 2 years ago

julianmrodri commented 2 years ago

Issue

Getting the following error when trying to import plyvel in Python console after installing leveldb.

Additional information and context can be found in this issue (https://github.com/ConsenSys/mythril/issues/1509). Redirected from their repo.

Steps I followed to install (which include leveldb).

brew update
brew upgrade
brew tap ethereum/ethereum
brew install leveldb
brew install solidity
pip3 install mythril

But after installation if I try to run simple plyvel import in Python console I get this error. It is likely the leveldb packages aren't linked to plyvel correctly?

Python 3.7.7 (v3.7.7:d7c567b08f, Mar 10 2020, 02:56:16) 
[Clang 6.0 (clang-600.0.57)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import plyvel 
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/plyvel/__init__.py", line 6, in <module>
    from ._plyvel import (  # noqa
ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/plyvel/_plyvel.cpython-37m-darwin.so, 2): Symbol not found: __ZTIN7leveldb10ComparatorE
  Referenced from: /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/plyvel/_plyvel.cpython-37m-darwin.so
  Expected in: flat namespace
 in /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/plyvel/_plyvel.cpython-37m-darwin.so
>>> 

Enviroment

Python version: python -V returns Python 2.7.161. python3 -V returns Python 3.7.7 OS and Version: MacOS Big Sur

edopelawi commented 2 years ago

@julianmrodri Hey there, I stumbled upon similar issue. Do you happen to find any solution yet?

julianmrodri commented 2 years ago

@julianmrodri Hey there, I stumbled upon similar issue. Do you happen to find any solution yet?

No.. had to move to another installation method using Docker.

ksato9700 commented 2 years ago

It looks like this issue is a duplication of #114. In the latest version (1.23), it disabled RTTI, that causes this issue. I resolved the problem by uninstalling homebrew version and install leveldb 1.22 from the source code.