-
Notifications
You must be signed in to change notification settings - Fork 77
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
installation failed on mac osx 10.15 #114
Comments
i don't use osx myself, sorry 😕 that said, there are a few seemingly similar (closed) issues in the issue tracker. maybe you can have a look, and if that doesn't help, gently ping some more knowledgeable people in this issue. |
I met one similar issue and have solved it by installing
|
In my case I was not able to install Try:
Update: Spoke too soon. Installation went fine, however when I try to run a Python script that uses |
I'm getting the exact same error. To give a little more context:
Tried both Python3.8 and Python3.9. All worked well before updating, and leveldb released a new version 15 days ago, so I'm guessing there's gonna be something there, but cannot install 1.22 from brew again so I've been unable to test it :( |
Got it to work by reinstalling |
did you recompile plyvel after upgrading leveldb? if not, i think you should. |
I did after upgrading / downgrading. It only work aster downgrading and recompiling. |
are you sure it recompiled (and didn't use some cached wheel somewhere on your disk)? |
@wbolster looks like that was the issue indeed, it was building using and old cached version. Sorry for the unnecessary noise. |
@sr-gi How did you install leveldb 1.22? It seems brew no longer supports it. |
@rickwierenga I had to modify the formula myself to point to the proper version. You can get historical versions by browsing homebrew's GitHub. |
Seems to me that a leveldb 1.23 change disabled RTTI, and typeinfo symbols are missing from the built library, whereas they were present in leveldb 1.22. See related issue google/leveldb#731 |
Managed to get it to work as well with In order to get Once
|
Tested that a custom built
|
Thanks @bagonyi
|
I also encounter this error on ...
extra_compile_args = ['-Wall', '-g', '-x', 'c++', '-std=c++11', '-fno-rtti']
... After that, this problem was fixed. python3 -c "import plyvel; print(plyvel.__leveldb_version__); print(plyvel.__version__)"
1.23
1.3.0
(venv) In addition, I also built |
Seems like this also occurs when using MacPorts, although the error is different:
Both Python 3.8 and its virtualenv package come from MacPorts so it should pick up the proper include directory ( |
…rg/project/plyvel-wheels/#files - Which fixes this problem: wbolster/plyvel#114 for details on "Symbol not found: __ZTIN7leveldb10ComparatorE" error - By including a statically linked leveldb v 1.22 in the wheel (for Mac). - This also saves the user from needing to perform a "brew install leveldb" step and is therefore an essential part of making the SDK a one-click-installation...
Hii, just installed leveldb@1.22 following @bagonyi tips and works fine for me
|
I'm also getting this error on trying to pip install plyvel or install it from source, with leveldb installed through homebrew, on an M1 (arm) mac |
Just solved this by prefixing either the |
I don't know if that help, but I succeeded to build it on freebsd with this command: |
M1 Mac Monterey. Using this + build leveldb from source @ 1.22.0 help
|
This worked for me with Monterey and homebrew:
I'm on an M1 machine so you may have to amend the -I and -L argments. |
@bocheng0000 Thanks! install leveldb before plyvel is works for me. |
The command given above might not work for everyone, if for whatever reason the Homebrew symlinks are not under You can get the install directory of any Homebrew package with CFLAGS="-I$(brew --prefix leveldb)/include/ -L$(brew --prefix leveldb)/lib/ -fno-rtti" pip install --force-reinstall --global-option="build_ext" plyvel Verify that the library was linked without issues by simply loading the module: python -c 'import plyvel' |
Another approach is switch to MacPorts where I keep RTTI at LevelDB as a variant and by default it builds with it. So, |
Also happening from M2 (arm) mac... I already tried with leveldb@1.22 version and all flags specified in this thread. |
This worked for me on M1 / 14.3 with simple CFLAGS="-I/opt/homebrew/include -w" LDFLAGS="-L/opt/homebrew/lib" pip install plyvel |
I was running into the same issue as @trungtin, and solved it by building Thanks for all the suggestions in this thread! |
This works for me on MacOs Sonoma M2 Pro
|
This is the only solution that worked for me on an M3 Max running Sonoma 14.2.1. |
Same here! It worked to me with same proc! :) |
works for me on M2 Ventura 13.6 |
Traceback (most recent call last): File "/opt/venv/bin/pyrobud", line 5, in <module> from pyrobud.main import main File "/opt/venv/lib/python3.12/site-packages/pyrobud/main.py", line 4, in <module> from . import DEFAULT_CONFIG_PATH, __description__, launch, logs File "/opt/venv/lib/python3.12/site-packages/pyrobud/launch.py", line 9, in <module> from . import DEFAULT_CONFIG_PATH, util File "/opt/venv/lib/python3.12/site-packages/pyrobud/util/__init__.py", line 1, in <module> from . import ( File "/opt/venv/lib/python3.12/site-packages/pyrobud/util/config.py", line 11, in <module> from .config_db_migrator import upgrade_v3 File "/opt/venv/lib/python3.12/site-packages/pyrobud/util/config_db_migrator.py", line 4, in <module> import plyvel File "/opt/venv/lib/python3.12/site-packages/plyvel/__init__.py", line 6, in <module> from ._plyvel import ( # noqa ImportError: Error relocating /opt/venv/lib/python3.12/site-packages/plyvel/_plyvel.cpython-312-x86_64-linux-musl.so: _ZTIN7leveldb10ComparatorE: symbol not found * Ref: wbolster/plyvel#114 (comment) Change-Id: I1882a7bedbabed34a705dae385b884e754f01b19
All upper receipts didn't work for me, so I have found my solution: brew install leveldb
CFLAGS="-I/usr/local/Cellar/leveldb/1.23_1/include -fno-rtti" LDFLAGS="-L/usr/local/Cellar/leveldb/1.23_1/lib" pip3 install plyvel --no-cache-dir |
None of the above commands work for me (on a venerable x86-64 MacBook Pro with MacOS 13.6 and (the important part) Python 3.12.1). The CFLAGS are not being passed into the build process (you can verify this by adding diff --git a/setup.py b/setup.py
index cdebab5..33dc75b 100644
--- a/setup.py
+++ b/setup.py
@@ -14,7 +14,7 @@ def get_file_contents(filename):
return fp.read()
-extra_compile_args = ['-Wall', '-g', '-x', 'c++', '-std=c++11']
+extra_compile_args = ['-Wall', '-g', '-x', 'c++', '-std=c++11', '-fno-rtti']
if platform.system() == 'Darwin':
extra_compile_args += ['-stdlib=libc++'] then compile/install, no extra flags needed in my case: pip install -r requirements-dev.txt # needed because see below
make # needed because see below
pip install --force-reinstall . Of course, plyvel has some ancient |
Sorry to pick on plyvel here, the real problem is that LevelDB made an ABI incompatible change in a minor version update (who does that???) google/leveldb#927 It might be possible to add a check to |
just fyi this seemed sensible, at least in prehistoric times (12 years ago) 🧓🏼 see this commit 66028d8 |
Indeed, it definitely made sense in the stone age of Python packaging when there was no good solution for build dependencies! |
Hi there. If you need the already built binary plyvel packages for windows, Linux and macOS, please feel free to have a look at #152. It has built and packaged leveldb and snappy within it. |
with Make also needed to pass the directories via setup.py. There's probably an easier way but this worked when I needed it. -extra_compile_args = ['-Wall', '-g', '-x', 'c++', '-std=c++11']
+extra_compile_args = ['-Wall', '-g', '-x', 'c++', '-std=c++11', '-fno-rtti']
if platform.system() == 'Darwin':
extra_compile_args += ['-stdlib=libc++']
@@ -25,6 +25,8 @@ def get_file_contents(filename):
sources=['plyvel/_plyvel.cpp', 'plyvel/comparator.cpp'],
libraries=['leveldb'],
extra_compile_args=extra_compile_args,
+ include_dirs=['/opt/homebrew/Cellar/leveldb/1.23_1/include/'],
+ library_dirs=['/opt/homebrew/Cellar/leveldb/1.23_1/lib/'],
)
] |
Hello,
I know that there are certain issues with the Mac OSX and their version of the GCC compiler. I did install the Gnu GCC, but all the recommended methods of convincing OSX to use the Gnu compiler have failed.
I tried to install plyvel with pip and got fail messages. This is what I get - at least the essential bit.
Complete output (16 lines): running install running build running build_py creating build creating build/lib.macosx-10.6-intel-3.7 creating build/lib.macosx-10.6-intel-3.7/plyvel copying plyvel/_version.py -> build/lib.macosx-10.6-intel-3.7/plyvel copying plyvel/__init__.py -> build/lib.macosx-10.6-intel-3.7/plyvel running build_ext building 'plyvel._plyvel' extension creating build/temp.macosx-10.6-intel-3.7 creating build/temp.macosx-10.6-intel-3.7/plyvel gcc -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch i386 -arch x86_64 -g -I/Library/Frameworks/Python.framework/Versions/3.7/include/python3.7m -c plyvel/_plyvel.cpp -o build/temp.macosx-10.6-intel-3.7/plyvel/_plyvel.o -Wall -g -x c++ -std=c++11 -stdlib=libc++ clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) error: command 'gcc' failed with exit status 1 ----------------------------------------
I obviously have an OSX later than 10.7, but for some reason this is not recognised.
I would be very grateful for any help concerning this issue.
Best
Pia
The text was updated successfully, but these errors were encountered: