Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plyvel not linked correctly to leveldb in MacOS #134

Open
julianmrodri opened this issue Sep 10, 2021 · 4 comments
Open

Plyvel not linked correctly to leveldb in MacOS #134

julianmrodri opened this issue Sep 10, 2021 · 4 comments

Comments

@julianmrodri
Copy link

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 (Consensys/mythril#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
Copy link

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

@julianmrodri
Copy link
Author

@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
Copy link

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.

@AlexV525
Copy link

AlexV525 commented Nov 10, 2024

To solve Symbol not found: __ZTIN7leveldb10ComparatorE on MacOS:

brew uninstall leveldb
# Fetches the LevelDB v1.22 formula.
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/e2c833d326c45d9aaf4e26af6dd8b2f31564dc04/Formula/leveldb.rb
brew install --formula ./leveldb.rb
export LIBRARY_PATH="$LIBRARY_PATH:$(brew --prefix)/lib"
export CPATH="$CPATH:$(brew --prefix)/include"
# Use pip3 maybe.
pip install plyvel

There are a few noticeable setups with my device:

  1. I'm using the Python installed with Homebrew, rather than from /usr/bin/python3.
  2. I've aliased python to python3, and pip to pip3.
  3. I'm using Python 3.10.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants