python - 用 pip 安装 plyvel

标签 python linux pip leveldb

我在尝试安装 plyvel 时遇到此错误:

  Running setup.py install for plyvel
    Complete output from command /home/eytan/.virtualenvs/env/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-NVZgbQ/plyvel/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-jHZNqS-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/eytan/.virtualenvs/env/include/site/python2.7/plyvel:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    creating build/lib.linux-x86_64-2.7/plyvel
    copying plyvel/__init__.py -> build/lib.linux-x86_64-2.7/plyvel
    copying plyvel/_version.py -> build/lib.linux-x86_64-2.7/plyvel
    running build_ext
    building 'plyvel._plyvel' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/plyvel
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c plyvel/_plyvel.cpp -o build/temp.linux-x86_64-2.7/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:24: fatal error: leveldb/db.h: No such file or directory
     #include "leveldb/db.h"
                            ^
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/home/eytan/.virtualenvs/env/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-NVZgbQ/plyvel/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-jHZNqS-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/eytan/.virtualenvs/env/include/site/python2.7/plyvel" failed with error code 1 in /tmp/pip-build-NVZgbQ/plyvel

谁能解释一下这是怎么回事,我该如何解决?

最佳答案

需要安装leveldb开发包。

基于 deb 的发行版:

sudo apt-get install libleveldb-dev

基于 RPM 的发行版:

sudo yum install leveldb-devel

请注意 dnf 正在缓慢但肯定会取代 yum。如果您的发行版使用 dnf(例如,Fedora 23 和更新版本),您可以将它放在那里而不是 yum:

sudo dnf install leveldb-devel

关于python - 用 pip 安装 plyvel,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32895804/

相关文章:

python - 使用 Python 请求发布方法但得到 401 响应代码

linux - 如何从熵池中停止/开发/随机填充。我可以卸载一个模块来做吗?

python - 卸载 Canopy Enthought 会留下奇怪的 bash 警告?

python - Pandas 基于两对列进行排序

python - Django:没有 CSS 和正确文本的 html

c++ - 检查串口是否有数据传入linux(cbInQue for linux)

java - 如何获取特定日志文件并在 jenkins 控制台输出中显示其内容

python - 安装适用于 Python 3.5.1 的 Pip。在 Mac OSX 10.5.8 上

python - RequestsDependencyWarning : urllib3 (1. 25.2) 或 chardet (3.0.4) 与支持的版本不匹配!使固定

python-2.7 - 64 位 Windows 7 上的 Python 32 或 64?安装 easy_install 会有什么影响?