wbolster / plyvel

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

Plyvel installation #58

Closed aniss05 closed 6 years ago

aniss05 commented 6 years ago

Hi everyone,

I am trying to install plyvel on my system but when I import the library in my code, I get the following error:

Traceback (most recent call last): File "", line 1, in File "/home/aniss/anaconda3/lib/python3.6/site-packages/plyvel/init.py", line 6, in from ._plyvel import ( # noqa ImportError: /home/aniss/anaconda3/lib/python3.6/site-packages/plyvel/_plyvel.cpython-36m-x86_64-linux-gnu.so: undefined symbol: _ZN7leveldb2DB4OpenERKNS_7OptionsERKNSt7__cxx1112basic_stringIcSt11chartraitsIcESaIcEEEPPS0

and following is the command that I used to install it:

pip install --global-option=build_ext --global-option="-I/usr/local/include" --global-option="-L/usr/local/lib" --no-cache-dir --no-deps Plyvel

Can anyone help me with this issue please, thank you in advance.

wbolster commented 6 years ago

hmmm, looks like a broken installation / compilation somehow. others have reported similar issues before. you can find those as closed issues for this github repo, maybe it helps you. try clearing ~/.pip/cache.

aniss05 commented 6 years ago

Hi thanks @wbolster for the reply, I did like you requested and I am getting this error now when I try to reinstall Plyvel I get the following error (Although I followed all the steps to install leveldb on my system):

Building wheels for collected packages: Plyvel Running setup.py bdist_wheel for Plyvel ... error Complete output from command /home/aniss/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/tmp/pip-build-5eiyx4o3/Plyvel/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" bdist_wheel -d /tmp/tmpvlvjyciupip-wheel- --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/plyvel copying plyvel/_version.py -> build/lib.linux-x86_64-3.6/plyvel copying plyvel/init.py -> build/lib.linux-x86_64-3.6/plyvel running build_ext building 'plyvel._plyvel' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/plyvel x86_64-conda_cos6-linux-gnu-gcc -pthread -Wno-unused-result -Wsign-compare -DNDEBUG -fwrapv -O2 -Wall -Wstrict-prototypes -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -march=nocona -mtune=haswell -ftree-vectorize -fPIC -fstack-protector-strong -fno-plt -O2 -pipe -fPIC -I/home/aniss/anaconda3/include/python3.6m -c plyvel/_plyvel.cpp -o build/temp.linux-x86_64-3.6/plyvel/_plyvel.o -Wall -g cc1plus: warning: command line option '-Wstrict-prototypes' is valid for C/ObjC but not for C++ plyvel/_plyvel.cpp:359:10: fatal error: leveldb/db.h: No such file or directory

include "leveldb/db.h"

        ^~~~~~~~~~~~~~

compilation terminated. error: command 'x86_64-conda_cos6-linux-gnu-gcc' failed with exit status 1

wbolster commented 6 years ago

your leveldb installation is not found, which is what the error is about: development headers cannot be found

aniss05 commented 6 years ago

Thanks @wbolster for the reply. I managed making it working by changing the Python version that I am using. Before that I was using Anaconda 3.6 and I have noticed that although the installation of LevelDB worked perfectly, I was getting the above error which for some reason that I cannot tell, does not detect the LevelDB headers. But when I switched to Debian Python package (Python 3 and Python3-pip), it just worked like a charm.

aniss05 commented 6 years ago

My conclusion is that Plyvel is not compatible with Anaconda (Python 3.6) for now. Correct me if I am wrong.

wbolster commented 6 years ago

good to hear you got it working somehow. :) it should be possible to run it with anaconda but it seems the magic incantations to get to that point remain a mystery for now. :)