Closed varikin closed 10 years ago
Are you sure the leveldb libs are in the LD_LIBRARY_PATH?
Do you have multiple LevelDB versions installed? Maybe this is a mismatch between compile time and runtime versions.
LD_LIBRARY_PATH wasn't set so I set it and it didn't make a difference. I then uninstalled LevelDB and Plylel and then reinstalled them with LD_LIBRARY_PATH set to see if it had any affect. It didn't. Here is the current setting of LD_LIBRARY_PATH.
$ ls /usr/local/lib/libleveldb.*
/usr/local/lib/libleveldb.1.15.dylib /usr/local/lib/libleveldb.1.dylib /usr/local/lib/libleveldb.a /usr/local/lib/libleveldb.dylib
$ echo $LD_LIBRARY_PATH
/usr/local/lib
I don't have much experience debugging issues like these. Did you compile LevelDB yourself using the same compiler?
I switched to working in Ubuntu Saucy and everything works. Not sure why my Mac environment is messed up, but considering I will be ultimately running this app from a Ubuntu, I am fine with this.
I don't think this issue should have been closed, since it's still broken on Mavericks. I still have this problem. Installed leveldb with brew, installed plyvel pip, and get the same missing symbol.
ImportError: dlopen(/Users/matt/Dropbox/workspace/env/py33whoosh/lib/python3.3/site-packages/plyvel/_plyvel.so, 2): Symbol not found: __ZN7leveldb2DB4OpenERKNS_7OptionsERKSsPPS0_
Referenced from: /Users/matt/Dropbox/workspace/env/py33whoosh/lib/python3.3/site-packages/plyvel/_plyvel.so
Expected in: flat namespace
in /Users/matt/Dropbox/workspace/env/py33whoosh/lib/python3.3/site-packages/plyvel/_plyvel.so
Reopening. Please help debugging this, I'm not sure what the problem is.
I'll do what I can :)
So, is this with multiple LevelDB installations? Is LevelDB installed and reachable by the loader (LD_LIBRARY_PATH maybe)?
Not familiar with this problem, but this looks similar to some extent: http://stackoverflow.com/questions/19737207/openssl-and-m2crypto-not-working-together-on-os-x-mavericks
And maybe this one as well: http://stackoverflow.com/questions/21867277/installing-pillow-with-mac-os-x-mavericks-10-9-1
I removed all python.org Pythons from my system and reinstalled using Homebrew's pythons, and now this works. It may have been a conflict between Homebrew's Leveldb and python.org Python.
Great, glad to hear that it works for you now. I'll close this issue, since it does not seem to caused by Plyvel after all.
I encountered the same problem. It looks to me that the problem is caused by different C++ standard libraries used by leveldb and plyvel.
When I install leveldb (in the standard way, make
), it is linked to libc++, which is the default standard library on OS X.
However, when I install plyvel, it is linked to libstdc++ for some unknown reason.
The name mangling is different for two libraries.
This command worked for me:
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install plyvel
I've encountered this issue as well, and so far can't find a solution. If plyvel relies on LD_LIBRARY_PATH, then you should know that on OS X El Capitan you can no longer use that due to possible security restrictions by the OS. I've seen this in other open-source projects that relies on this flag for loading libraries (e.g. see https://github.com/BVLC/caffe/issues/3227).
i cannot reproduce this.
on osx el capitan with homebrew I can build/run plyvel just fine on different python versions after i brew install leveldb
. the test suite passes; relevant snippets from the tox
output:
py26: commands succeeded
py27: commands succeeded
py33: commands succeeded
py34: commands succeeded
I have same problem on os x 10.11.3 with this commands:
brew install leveldb
pip install plyvel
plyvel package installed with wheels, so I try reinstall plyvel without wheels:
pip uninstall plyvel
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install --no-use-wheel plyvel
Maybe something wrong with wheel package?
plyvel does not provide wheel packages; those are built locally on your system by pip
i think, so yeah, removing them from your local cache may help.
Had the same issue, got it working by doing:
pip uninstall plyvel
CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install plyvel --no-cache-dir
The --no-cache-dir
was needed, if it is not provided, pip will re-use the previous compilation.
@flaviovdf His answer works for me. 👍 I install leveldb with homebrew, and install plyvel with pip. when i test "$python -c 'import plyvel'", it comes up the same 'Symbol' error. So i uninstall plyvel and reinstall with : CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install plyvel --no-cache-dir
Same problem on linux. I want to use commands like "CFLAGS='-mmacosx-version-min=10.7 -stdlib=libc++' pip install plyvel --no-cache-dir", but all failed
@troyoung this is about a mac osx specific issue. please open a new issue and provide all relevant information if your problem persists.
i have solved my problem by install leveldb@1.21 which default is @1.23
@jakeywu Unfortunately 1.21 does not work Apple Sillicon
Has anybody found an easy solution to this? Still an issue under ventura 13.2 (m1), leveldb 1.23, plyvel 1.5
Yeah, this doesn't work on MacOS Sonoma 14.2.1.
I have installed leveldb on a custom path using : https://github.com/wbolster/plyvel/blob/main/scripts/install-leveldb.sh
I have a new path where both lib/ and include/ folders are available. I included these paths when running make which successfully generates the .so object.
Now when I install the libray itself using pip install .
, it installs successfully. But when I do import it into a file it tells me the following :
Traceback (most recent call last):
File "/path/temp/plyvel/leveldb_stuff.py", line 1, in <module>
import plyvel
File "/path/temp/plyvel/plyvel/__init__.py", line 6, in <module>
from ._plyvel import ( # noqa
ImportError: dlopen(/path/temp/plyvel/plyvel/_plyvel.cpython-39-darwin.so, 0x0002): symbol not found in flat namespace '__ZTIN7leveldb10ComparatorE'
I am not sure if the lib path needs to be provided again somewhere. I mostly edited the setup.py
file.
NOTE that make
succeeded successfully and there is an .so file in the folder.
Trying to get Plyvel working on Mavericks. I have LevelDB 1.15 installed via homebrew. In a Python 3.3 virtualenv, after
pip install plyvel
, I get the following:The docs say to ensure the linker can find the shared library, but I am not sure how to do that with pip. When grepping for that symbol, I find something similar, but not exact. Is this a version mismatch or I am just not looking at the right things?