简体   繁体   English

如何为python 2.7安装sqlite3(如果默认未安装)

[英]How to install sqlite3 for python 2.7 ( if not installed by default )

I've installed python2.7 going through this tutorial: http://bicofino.io/2014/01/16/installing-python-2-dot-7-6-on-centos-6-dot-5/ 我已通过本教程安装了python2.7: http : //bicofino.io/2014/01/16/installing-python-2-dot-7-6-on-centos-6-dot-5/

everything's okay, but the python doesn't see sqlite module: 一切都很好,但是python没有看到sqlite模块:

ImportError: No module named _sqlite3

Is there a possibility to install it manually ? 是否可以手动安装?

Thanks in advance, 提前致谢,

I ran into this same issue when I was installing sqlite on a friends windows machine. 我在朋友的Windows计算机上安装sqlite时遇到了同样的问题。 You need to have the sqlite development files before installation. 在安装之前,您需要具有sqlite开发文件。 See link that people had this issue when installing on centos How to install pysqlite? 请参阅在centos 上安装时人们遇到此问题的链接。 如何安装pysqlite?

  • yum install sqlite-devel
  • cd <python directory>
  • ./configure --prefix=<installdir>; make; make install

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM