plyvel icon indicating copy to clipboard operation
plyvel copied to clipboard

cannot build plyvel(ld: library not found for -lleveldb)

Open superbag2010 opened this issue 1 year ago • 0 comments

When I did "pip install plyvel", linker couldn't find lleveldb and failed to build leveldb. I checked/tried 1)/2)/3), but didn't work. could you give me any idea?(I worked on MAC 12.5 with M1 chip.)

  1. checking leveldb installed : following is brew install leveldb result. ==> Downloading https://formulae.brew.sh/api/formula.jws.json ##################################################################################################################################################################################################### 100.0% ==> Downloading https://formulae.brew.sh/api/cask.jws.json ##################################################################################################################################################################################################### 100.0% Warning: leveldb 1.23 is already installed and up-to-date. To reinstall 1.23, run: brew reinstall leveldb
  2. adding leveldb path to LD_LIBRARY_PATH : following is "echo $LD_LIBRARY_PATH" result. /usr/local/include/leveldb
  3. track lleveldb, but can't find anything : "sudo find / -name "lleveldb" 2>/dev/null" returned nothing.

Please note "pip install plyvel" result. -------------------- "pip install plyvel" result --------------------- Defaulting to user installation because normal site-packages is not writeable Collecting plyvel Using cached plyvel-1.5.1.tar.gz (200 kB) Preparing metadata (setup.py) ... done Building wheels for collected packages: plyvel Building wheel for plyvel (setup.py) ... error error: subprocess-exited-with-error

× python setup.py bdist_wheel did not run successfully. │ exit code: 1 ╰─> [38 lines of output] running bdist_wheel running build running build_py creating build creating build/lib.macosx-10.9-universal2-3.9 creating build/lib.macosx-10.9-universal2-3.9/plyvel copying plyvel/_version.py -> build/lib.macosx-10.9-universal2-3.9/plyvel copying plyvel/init.py -> build/lib.macosx-10.9-universal2-3.9/plyvel running build_ext building 'plyvel._plyvel' extension creating build/temp.macosx-10.9-universal2-3.9 creating build/temp.macosx-10.9-universal2-3.9/plyvel clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -c plyvel/_plyvel.cpp -o build/temp.macosx-10.9-universal2-3.9/plyvel/_plyvel.o -Wall -g -x c++ -std=c++11 -stdlib=libc++ clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9 -c plyvel/comparator.cpp -o build/temp.macosx-10.9-universal2-3.9/plyvel/comparator.o -Wall -g -x c++ -std=c++11 -stdlib=libc++ plyvel/comparator.cpp:29:9: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations] PyEval_InitThreads(); ^ /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9/ceval.h:130:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); ^ /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED' #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated)) ^ 1 warning generated. plyvel/comparator.cpp:29:9: warning: 'PyEval_InitThreads' is deprecated [-Wdeprecated-declarations] PyEval_InitThreads(); ^ /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9/ceval.h:130:1: note: 'PyEval_InitThreads' has been explicitly marked deprecated here Py_DEPRECATED(3.9) PyAPI_FUNC(void) PyEval_InitThreads(void); ^ /Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/include/python3.9/pyport.h:508:54: note: expanded from macro 'Py_DEPRECATED' #define Py_DEPRECATED(VERSION_UNUSED) attribute((deprecated)) ^ 1 warning generated. clang++ -bundle -undefined dynamic_lookup -arch arm64 -arch x86_64 -Wl,-headerpad,0x1000 build/temp.macosx-10.9-universal2-3.9/plyvel/_plyvel.o build/temp.macosx-10.9-universal2-3.9/plyvel/comparator.o -lleveldb -o build/lib.macosx-10.9-universal2-3.9/plyvel/_plyvel.cpython-39-darwin.so ld: library not found for -lleveldb clang: error: linker command failed with exit code 1 (use -v to see invocation) error: command '/usr/bin/clang++' failed with exit code 1 [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. ERROR: Failed building wheel for plyvel Running setup.py clean for plyvel Failed to build plyvel ERROR: Could not build wheels for plyvel, which is required to install pyproject.toml-based projects -------------------- "pip install plyvel" result ---------------------

superbag2010 avatar Feb 12 '24 14:02 superbag2010