pip install lmdb 中的錯誤

  Downloading zipp-3.1.0-py3-none-any.whl (4.9 kB)
Building wheels for collected packages: absl-py, easydict, lmdb, termcolor, wrapt, gast, pandocfilters, tornado, pyrsistent
  Building wheel for absl-py (setup.py) ... done
  Created wheel for absl-py: filename=absl_py-0.9.0-py3-none-any.whl size=121931 sha256=4e5fbf0579743fc25f89fed23d253936918c259764fb062abe92be3f1bb1f25c
  Stored in directory: /home/mike/.cache/pip/wheels/c3/af/84/3962a6af7b4ab336e951b7877dcfb758cf94548bb1771e0679
  Building wheel for easydict (setup.py) ... done
  Created wheel for easydict: filename=easydict-1.9-py3-none-any.whl size=6349 sha256=0c8d8b3ce43c0cd64f4dd48ed74c75318b916798f2e45fc5c33c063b558a6ab4
  Stored in directory: /home/mike/.cache/pip/wheels/5d/79/e4/4e55effe206295359b37e0f9db3e68a1197ba396682807dadb
  Building wheel for lmdb (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/mike/env36/bin/python36 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vbpwwau3/lmdb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vbpwwau3/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-fwhkkj2o
       cwd: /tmp/pip-install-vbpwwau3/lmdb/
  Complete output (21 lines):
  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/__init__.py -> build/lib.linux-x86_64-3.6/lmdb
  copying lmdb/__main__.py -> build/lib.linux-x86_64-3.6/lmdb
  copying lmdb/_config.py -> build/lib.linux-x86_64-3.6/lmdb
  copying lmdb/cffi.py -> build/lib.linux-x86_64-3.6/lmdb
  copying lmdb/tool.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/mike/env36/include/python3.6m -c lmdb/cpython.c -o build/temp.linux-x86_64-3.6/lmdb/cpython.o -UNDEBUG -w
  unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for lmdb
  Running setup.py clean for lmdb
  Building wheel for termcolor (setup.py) ... done
  Created wheel for termcolor: filename=termcolor-1.1.0-py3-none-any.whl size=4830 sha256=9be1bd5d374841f4ae45fd538d672e8df7169746fd4eb7a581c112d4987a810d
  Stored in directory: /home/mike/.cache/pip/wheels/93/2a/eb/e58dbcbc963549ee4f065ff80a59f274cc7210b6eab962acdc
  Building wheel for wrapt (setup.py) ... done
  Created wheel for wrapt: filename=wrapt-1.12.1-py3-none-any.whl size=19553 sha256=7932eff8eb9257e66e9de034672162b4c1a65b0ac557500d187e1556b058e80c
  Stored in directory: /home/mike/.cache/pip/wheels/32/42/7f/23cae9ff6ef66798d00dc5d659088e57dbba01566f6c60db63
  Building wheel for gast (setup.py) ... done
  Created wheel for gast: filename=gast-0.2.2-py3-none-any.whl size=7539 sha256=ba66187bb295217583e11c31f314fdbec1bd5430b74004f267c64d1e99426722
  Stored in directory: /home/mike/.cache/pip/wheels/19/a7/b9/0740c7a3a7d1d348f04823339274b90de25fbcd217b2ee1fbe
  Building wheel for pandocfilters (setup.py) ... done
  Created wheel for pandocfilters: filename=pandocfilters-1.4.2-py3-none-any.whl size=7856 sha256=f9f57ae3da152d104db4cc0d9ed7b7e7610a4ebbf09f70bf468b1d678b62d2d1
  Stored in directory: /home/mike/.cache/pip/wheels/46/c4/40/718c6fd14c2129ccaee10e0cf03ef6c4d01d98cad5dbbfda38
  Building wheel for tornado (setup.py) ... done
  Created wheel for tornado: filename=tornado-6.0.4-cp36-cp36m-linux_x86_64.whl size=415151 sha256=822b18f7772fb9344b86d5f3314cdfc7eedce9a60eb11e7de6fba9646f4f1a64
  Stored in directory: /home/mike/.cache/pip/wheels/37/a7/db/2d592e44029ef817f3ef63ea991db34191cebaef087a96f505
  Building wheel for pyrsistent (setup.py) ... done
  Created wheel for pyrsistent: filename=pyrsistent-0.16.0-cp36-cp36m-linux_x86_64.whl size=56582 sha256=e118223d1a3f44d303095358a18839e1e0d8e951c47a6e9162c99af0bb2c658c
  Stored in directory: /home/mike/.cache/pip/wheels/d1/8a/1c/32ab9017418a2c64e4fbaf503c08648bed2f8eb311b869a464
Successfully built absl-py easydict termcolor wrapt gast pandocfilters tornado pyrsistent
Failed to build lmdb
Installing collected packages: six, absl-py, easydict, cython, googledrivedownloader, decorator, pygments, wcwidth, prompt-toolkit, ipython-genutils, traitlets, ptyprocess, pexpect, parso, jedi, pickleshare, backcall, ipython, tornado, pyzmq, jupyter-core, python-dateutil, jupyter-client, ipykernel, Send2Trash, terminado, entrypoints, webencodings, pyparsing, packaging, bleach, testpath, mistune, MarkupSafe, jinja2, attrs, pyrsistent, zipp, importlib-metadata, jsonschema, nbformat, defusedxml, pandocfilters, nbconvert, prometheus-client, notebook, widgetsnbextension, ipywidgets, jupyter-console, qtpy, qtconsole, jupyter, lmdb, kiwisolver, cycler, numpy, matplotlib, Pillow, pytz, pandas, scipy, seaborn, termcolor, astor, keras-preprocessing, tensorflow-estimator, protobuf, google-pasta, h5py, keras-applications, wrapt, grpcio, markdown, werkzeug, tensorboard, opt-einsum, gast, tensorflow-gpu, tqdm
    Running setup.py install for lmdb ... error
    ERROR: Command errored out with exit status 1:
     command: /home/mike/env36/bin/python36 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vbpwwau3/lmdb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vbpwwau3/lmdb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_e_hsjm2/install-record.txt --single-version-externally-managed --compile --install-headers /home/mike/env36/include/site/python3.6/lmdb
         cwd: /tmp/pip-install-vbpwwau3/lmdb/
    Complete output (21 lines):
    py-lmdb: Using bundled liblmdb; override with LMDB_FORCE_SYSTEM=1.
    py-lmdb: Using CPython extension; override with LMDB_FORCE_CFFI=1.
    running install
    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/__init__.py -> build/lib.linux-x86_64-3.6/lmdb
    copying lmdb/__main__.py -> build/lib.linux-x86_64-3.6/lmdb
    copying lmdb/_config.py -> build/lib.linux-x86_64-3.6/lmdb
    copying lmdb/cffi.py -> build/lib.linux-x86_64-3.6/lmdb
    copying lmdb/tool.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/mike/env36/include/python3.6m -c lmdb/cpython.c -o build/temp.linux-x86_64-3.6/lmdb/cpython.o -UNDEBUG -w
    unable to execute 'x86_64-linux-gnu-gcc': No such file or directory
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/mike/env36/bin/python36 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vbpwwau3/lmdb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vbpwwau3/lmdb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-_e_hsjm2/install-record.txt --single-version-externally-managed --compile --install-headers /home/mike/env36/include/site/python3.6/lmdb Check the logs for full command output.

執行下列代碼:(python-dev是2.7。3.x, 3.4和 3.7要找相應的版本)

apt-get install libxml2-dev libxslt1-dev python-dev

apt-get install zlib1g-dev

apt-get install libevent-dev

(pip install lxml)

然後錯誤:

(env3) mike@DESKTOP-JRHQF35:~/env3/bin$ pip install lmdb
Collecting lmdb
  Using cached lmdb-0.98.tar.gz (869 kB)
Building wheels for collected packages: lmdb
  Building wheel for lmdb (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /home/mike/env3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tan384lf/lmdb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tan384lf/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-_tq6ts4_
       cwd: /tmp/pip-install-tan384lf/lmdb/
  Complete output (24 lines):
  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.5
  creating build/lib.linux-x86_64-3.5/lmdb
  copying lmdb/__init__.py -> build/lib.linux-x86_64-3.5/lmdb
  copying lmdb/__main__.py -> build/lib.linux-x86_64-3.5/lmdb
  copying lmdb/_config.py -> build/lib.linux-x86_64-3.5/lmdb
  copying lmdb/cffi.py -> build/lib.linux-x86_64-3.5/lmdb
  copying lmdb/tool.py -> build/lib.linux-x86_64-3.5/lmdb
  running build_ext
  building 'cpython' extension
  creating build/temp.linux-x86_64-3.5
  creating build/temp.linux-x86_64-3.5/lmdb
  creating build/temp.linux-x86_64-3.5/lib
  x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ilib/py-lmdb -Ilib -I/usr/include/python3.5m -I/home/mike/env3/include/python3.5m -c lmdb/cpython.c -o build/temp.linux-x86_64-3.5/lmdb/cpython.o -UNDEBUG -w
  lmdb/cpython.c:26:10: fatal error: Python.h: No such file or directory
   #include "Python.h"
            ^~~~~~~~~~
  compilation terminated.
  error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for lmdb
  Running setup.py clean for lmdb
Failed to build lmdb
Installing collected packages: lmdb
    Running setup.py install for lmdb ... error
    ERROR: Command errored out with exit status 1:
     command: /home/mike/env3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tan384lf/lmdb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tan384lf/lmdb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-o0tc6tai/install-record.txt --single-version-externally-managed --compile --install-headers /home/mike/env3/include/site/python3.5/lmdb
         cwd: /tmp/pip-install-tan384lf/lmdb/
    Complete output (24 lines):
    py-lmdb: Using bundled liblmdb; override with LMDB_FORCE_SYSTEM=1.
    py-lmdb: Using CPython extension; override with LMDB_FORCE_CFFI=1.
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-3.5
    creating build/lib.linux-x86_64-3.5/lmdb
    copying lmdb/__init__.py -> build/lib.linux-x86_64-3.5/lmdb
    copying lmdb/__main__.py -> build/lib.linux-x86_64-3.5/lmdb
    copying lmdb/_config.py -> build/lib.linux-x86_64-3.5/lmdb
    copying lmdb/cffi.py -> build/lib.linux-x86_64-3.5/lmdb
    copying lmdb/tool.py -> build/lib.linux-x86_64-3.5/lmdb
    running build_ext
    building 'cpython' extension
    creating build/temp.linux-x86_64-3.5
    creating build/temp.linux-x86_64-3.5/lmdb
    creating build/temp.linux-x86_64-3.5/lib
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Ilib/py-lmdb -Ilib -I/usr/include/python3.5m -I/home/mike/env3/include/python3.5m -c lmdb/cpython.c -o build/temp.linux-x86_64-3.5/lmdb/cpython.o -UNDEBUG -w
    lmdb/cpython.c:26:10: fatal error: Python.h: No such file or directory
     #include "Python.h"
              ^~~~~~~~~~
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/mike/env3/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-tan384lf/lmdb/setup.py'"'"'; __file__='"'"'/tmp/pip-install-tan384lf/lmdb/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-o0tc6tai/install-record.txt --single-version-externally-managed --compile --install-headers /home/mike/env3/include/site/python3.5/lmdb Check the logs for full command output.

這個時候檢查python-dev的版本,我的python-dev是3.6,上面是我在python3.5的環境中安裝的,所以不成功,然後我用virtualenv切換到3.6環境:

(env36) mike@DESKTOP-JRHQF35:~/env36/bin$ pip install lmdb
Collecting lmdb
  Using cached lmdb-0.98.tar.gz (869 kB)
Building wheels for collected packages: lmdb
  Building wheel for lmdb (setup.py) ... done
  Created wheel for lmdb: filename=lmdb-0.98-cp36-cp36m-linux_x86_64.whl size=218591 sha256=41b20579ede29fb7ea4ef5d3fb425f8ec84b093e707ba1fc136416f0c6acb4ec
  Stored in directory: /home/mike/.cache/pip/wheels/6e/53/3d/5a93174b38712013b3a3b3df15ea2a5144bd11b22edb84a14b
Successfully built lmdb
Installing collected packages: lmdb
Successfully installed lmdb-0.98

成功了5555555555555555555555555555

必須吐槽,python的版本太噁心了。

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章