gpt4 book ai didi

gcc - pip install pysqlite 导致以下错误 : command 'x86_64-linux-gnu-gcc' failed with exit status 1 and `#include "sqlite3. h"`

转载 作者:行者123 更新时间:2023-12-04 16:22:01 29 4
gpt4 key购买 nike

pip install pysqlite失败,并输出以下错误日志:

➜  ~  pip install pysqlite
Collecting pysqlite
Using cached pysqlite-2.6.3.tar.gz
Installing collected packages: pysqlite
Running setup.py install for pysqlite
Complete output from command /home/nathan/.virtualenvs/tox/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-KwYD65/pysqlite/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-K7uywC-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/nathan/.virtualenvs/tox/include/site/python2.7/pysqlite:
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/pysqlite2
copying lib/__init__.py -> build/lib.linux-x86_64-2.7/pysqlite2
copying lib/dump.py -> build/lib.linux-x86_64-2.7/pysqlite2
copying lib/dbapi2.py -> build/lib.linux-x86_64-2.7/pysqlite2
creating build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/types.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/userfunctions.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/transactions.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/factory.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/hooks.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/__init__.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/regression.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/dump.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
copying lib/test/dbapi.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
creating build/lib.linux-x86_64-2.7/pysqlite2/test/py25
copying lib/test/py25/__init__.py -> build/lib.linux-x86_64-2.7/pysqlite2/test/py25
copying lib/test/py25/py25tests.py -> build/lib.linux-x86_64-2.7/pysqlite2/test/py25
running build_ext
building 'pysqlite2._sqlite' extension
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
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 -DMODULE_NAME="pysqlite2.dbapi2" -DSQLITE_OMIT_LOAD_EXTENSION=1 -I/usr/include/python2.7 -c src/module.c -o build/temp.linux-x86_64-2.7/src/module.o
In file included from src/module.c:24:0:
src/connection.h:33:21: fatal error: sqlite3.h: No such file or directory
#include "sqlite3.h"
^
compilation terminated.
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

----------------------------------------
Command "/home/nathan/.virtualenvs/tox/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-KwYD65/pysqlite/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-K7uywC-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/nathan/.virtualenvs/tox/include/site/python2.7/pysqlite" failed with error code 1 in /tmp/pip-build-KwYD65/pysqlite
➜ ~
快速浏览了 stackoverflow 村的其余部分,发现了这个:
"error: command 'x86_64-linux-gnu-gcc' failed with exit status 1" in virtualenv
看起来很相似,但与sqlite没有太大关系。无论如何,那里提供的解决方案对这个问题不起作用。
我已经使用 sudo apt-get install sqlite 安装了 sqlite , sqlite3 使用 sudo apt-get instal sqlite3并使用 sudo apt-get install sqlitebrowser 安装了 sqlitebrowser .
enter image description here
zsh 自动完成功能为我提供了 SQLite 的其他几个选项,但它们大多看起来像文档或不相关的专用扩展。
我使用 Aptitude 搜索了可能的其他依赖项,如下( aptitude search sqlite ):
http://0bin.net/paste/-uv52OUbPGa5t-RJ#6VI1bgLbKqdhTUwBue0pO9yF63F3yfF++GtozB0ZI7S
我不认为在列表中安装任何我喜欢的库并在此过程中每次尝试,当我确定其他人以前遇到过这个问题时,这是不明智的。
PySQLite 文档似乎也没有太多关于 Debian 依赖项的信息。
https://readthedocs.org/search/project/?q=dependency&selected_facets=project_exact%3Apysqlite
我的理论是我只需要合适的图书馆。如果您不知道应该用哪个正确的答案来回答,请随时发表评论并提供有关如何更高效地开始搜索的建议。
如何修复 command 'x86_64-linux-gnu-gcc' failed with exit status 1 ... #include "sqlite3.h" pip install pysqlite 的 gcc 编译步骤错误?

最佳答案

没有这样的标题,也许你忘了安装主题:)
linux 使用 libsqlite3-dev 单独安装它们

sudo apt-get install libsqlite3-dev

关于gcc - pip install pysqlite 导致以下错误 : command 'x86_64-linux-gnu-gcc' failed with exit status 1 and `#include "sqlite3. h"`,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30900783/

29 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com