设为首页收藏本站

ZMX - IT技术交流论坛 - 无限Perfect,追求梦想 - itzmx.com

 找回密码
 注册论坛

QQ登录

只需一步,快速开始

新浪微博账号登陆

只需一步,快速开始

用百度帐号登录

只需两步,快速登录

搜索
查看: 2630|回复: 0

pip install pysqlite安装报错

[复制链接]
 成长值: 255

签到天数: 4710 天

[LV.Master]伴坛终老

发表于 2018/3/20 06:23 | 显示全部楼层 |阅读模式 |Google Chrome 65.0.3325.146|Windows 10
天涯海角搜一下: 百度 谷歌 360 搜狗 有道 雅虎 必应 即刻
[root@207 ]# pip install pysqlite
Collecting pysqlite
  Using cached pysqlite-2.8.3.tar.gz
Building wheels for collected packages: pysqlite
  Running setup.py bdist_wheel for pysqlite ... error
  Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dizXCQ/pysqlite/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/tmp4ZjCBFpip-wheel- --python-tag cp27:
  running bdist_wheel
  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/dbapi2.py -> 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
  creating 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/dbapi.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/__init__.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/userfunctions.py -> 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/hooks.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
  copying lib/test/dump.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
  running build_ext
  building 'pysqlite2._sqlite' extension
  creating build/temp.linux-x86_64-2.7
  creating build/temp.linux-x86_64-2.7/src
  gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -IPackage -Isqlite3 -Iwas -Inot -Ifound -Iin -Ithe -Ipkg-config -Isearch -Ipath. -IPerhaps -Iyou -Ishould -Iadd -Ithe -Idirectory -Icontaining -I`sqlite3.pc' -Ito -Ithe -IPKG_CONFIG_PATH -Ienvironment -Ivariable -INo -Ipackage -I'sqlite3' -Ifound -I/usr/local/include/python2.7 -c src/module.c -o build/temp.linux-x86_64-2.7/src/module.o
  在包含自 src/module.c:24 的文件中:
  src/connection.h:33:21: 错误:sqlite3.h:没有那个文件或目录
  In file included from src/module.c:24:
  src/connection.h:38: 错误:expected specifier-qualifier-list before ‘sqlite3’
  In file included from src/module.c:25:
  src/statement.h:37: 错误:expected specifier-qualifier-list before ‘sqlite3’
  src/module.c: 在函数‘module_connect’中:
  src/module.c:63: 错误:‘SQLITE_OPEN_READWRITE’未声明(在此函数内第一次使用)
  src/module.c:63: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
  src/module.c:63: 错误:所在的函数内也只报告一次。)
  src/module.c:63: 错误:‘SQLITE_OPEN_CREATE’未声明(在此函数内第一次使用)
  src/module.c: 在函数‘module_complete’中:
  src/module.c:102: 警告:隐式声明函数‘sqlite3_complete’
  src/module.c: 在函数‘init_sqlite’中:
  src/module.c:401: 警告:隐式声明函数‘sqlite3_libversion’
  src/module.c:401: 警告:传递‘PyString_FromString’的第 1 个参数时将整数赋给指针,未作类型转换
  /usr/local/include/python2.7/stringobject.h:63: 附注:需要类型‘const char *’,但实参的类型为‘int’
  error: command 'gcc' failed with exit status 1
  
  ----------------------------------------
  Failed building wheel for pysqlite
  Running setup.py clean for pysqlite
Failed to build pysqlite
Installing collected packages: pysqlite
  Running setup.py install for pysqlite ... error
    Complete output from command /usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dizXCQ/pysqlite/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-e6pGJC-record/install-record.txt --single-version-externally-managed --compile:
    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/dbapi2.py -> 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
    creating 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/dbapi.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/__init__.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/userfunctions.py -> 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/hooks.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
    copying lib/test/dump.py -> build/lib.linux-x86_64-2.7/pysqlite2/test
    running build_ext
    building 'pysqlite2._sqlite' extension
    creating build/temp.linux-x86_64-2.7
    creating build/temp.linux-x86_64-2.7/src
    gcc -pthread -fno-strict-aliasing -g -O2 -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -IPackage -Isqlite3 -Iwas -Inot -Ifound -Iin -Ithe -Ipkg-config -Isearch -Ipath. -IPerhaps -Iyou -Ishould -Iadd -Ithe -Idirectory -Icontaining -I`sqlite3.pc' -Ito -Ithe -IPKG_CONFIG_PATH -Ienvironment -Ivariable -INo -Ipackage -I'sqlite3' -Ifound -I/usr/local/include/python2.7 -c src/module.c -o build/temp.linux-x86_64-2.7/src/module.o
    在包含自 src/module.c:24 的文件中:
    src/connection.h:33:21: 错误:sqlite3.h:没有那个文件或目录
    In file included from src/module.c:24:
    src/connection.h:38: 错误:expected specifier-qualifier-list before ‘sqlite3’
    In file included from src/module.c:25:
    src/statement.h:37: 错误:expected specifier-qualifier-list before ‘sqlite3’
    src/module.c: 在函数‘module_connect’中:
    src/module.c:63: 错误:‘SQLITE_OPEN_READWRITE’未声明(在此函数内第一次使用)
    src/module.c:63: 错误:(即使在一个函数内多次出现,每个未声明的标识符在其
    src/module.c:63: 错误:所在的函数内也只报告一次。)
    src/module.c:63: 错误:‘SQLITE_OPEN_CREATE’未声明(在此函数内第一次使用)
    src/module.c: 在函数‘module_complete’中:
    src/module.c:102: 警告:隐式声明函数‘sqlite3_complete’
    src/module.c: 在函数‘init_sqlite’中:
    src/module.c:401: 警告:隐式声明函数‘sqlite3_libversion’
    src/module.c:401: 警告:传递‘PyString_FromString’的第 1 个参数时将整数赋给指针,未作类型转换
    /usr/local/include/python2.7/stringobject.h:63: 附注:需要类型‘const char *’,但实参的类型为‘int’
    error: command 'gcc' failed with exit status 1
   
    ----------------------------------------
Command "/usr/local/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-dizXCQ/pysqlite/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-e6pGJC-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-dizXCQ/pysqlite/


解决方法
  1. yum -y install sqlite-devel
  2. pip install pysqlite
复制代码


欢迎光临IT技术交流论坛:http://bbs.itzmx.com/
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 注册论坛 新浪微博账号登陆用百度帐号登录

本版积分规则

手机版|Archiver|Mail me|网站地图|IT技术交流论坛 ( 闽ICP备13013206号-7 )

GMT+8, 2024/11/26 01:51 , Processed in 0.148641 second(s), 19 queries , MemCache On.

Powered by itzmx! X3.4

© 2011- sakura

快速回复 返回顶部 返回列表