菜鸟落泪:安装 python lmdb 踩的坑。

Ubuntu 系统 venv虚拟环境下安装 lmdb (python 3.6)踩的坑

由于种种原因,需要在venv 环境下安装 python 3.6版本的 lmdb 库,本来系统自带的 python 是2.7版本的,所以我电脑里有两个版本的 python (2.7 和 3.6),这是背景。
一开始进入venv 虚拟环境:

source venv/bin/activate

然后命令行状态变为:

(venv) shopping1@ubuntu:/usr/local/lib/python3.6/dist-packages$

一开始,输入 pip 命令安装 lmdb:

(venv) shopping1@ubuntu:/usr/local/lib/python3.6/dist-packages$ pip install lmdb
Collecting lmdb
  Using cached https://files.pythonhosted.org/packages/86/5c/6ad690daeaa00b328606bf2fa435244a11cc2dd9aedac6ef4d2ef2a21f6e/lmdb-0.96.tar.gz
Building wheels for collected packages: lmdb
  Building wheel for lmdb (setup.py) ... error
  ERROR: Complete output from command /home/shopping1/venv/bin/python3 -u -c 'import setuptools, tokenize;__file__='"'"'/tmp/pip-install-gpueg0ga/lmdb/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/pip-wheel-_1wwwpml --python-tag cp36:
  ERROR: py-lmdb: Using bundled liblmdb; override with LMDB_FORCE_SYSTEM=1.
  py-lmdb: Using CPython extension; override with LMDB_FORCE_CFFI=1.
  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/lmdb
  copying lmdb/cffi.py -> build/lib.linux-x86_64-3.6/lmdb
  copying lmdb/__main__.py -> build/lib.linux-x86_64-3.6/lmdb
  copying lmdb/tool.py -> build/lib.linux-x86_64-3.6/lmdb
  copying lmdb/_config.py -> build/lib.linux-x86_64-3.6/lmdb
  copying lmdb/__init__.py -> build/lib.linux-x86_64-3.6/lmdb
  running build_ext
  building 'cpython' extension
  creating build/temp.linux-x86_64-3.6
  creating build/temp.linux-x86_64-3.6/lmdb
  creating build/temp.linux-x86_64-3.6/lib
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ilib/py-lmdb -Ilib -I/usr/include/python3.6m -I/home/shopping1/venv/include/python3.6m -c lmdb/cpython.c -o build/temp.linux-x86_64-3.6/lmdb/cpython.o -UNDEBUG -w
  lmdb/cpython.c:42:10: fatal 
  • 2
    点赞
  • 5
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值