Problem with installing sqlite3 module for python 2.6 on an ubuntu system
Solution 1
File "/usr/local/lib/python2.6/sqlite3/__init__.py", line 24, in
That is not the python that comes with Ubuntu. either:
- Install
libsqlite3-dev
and re-build that version of python, or - use /usr/bin/python
Solution 2
It's probably sudo aptitude install python2.6-sqlite
, depending on which version of Ubuntu you're running. You may need to update your packages first if you don't do that regularly (sudo aptitude update
).
Do you have the appropriate sqlite3 packages installed? If you do dpkg -l | egrep sqlite3
I'd expect at least 3 packages to show up, including sqlite3
and libsqlite3-0
. You may also need python2.6-pysqlite2
.
Try sudo aptitude install python2.6-pysqlite2 sqlite3 libsqlite3-0
Related videos on Youtube
Hoang Pham
I was born in Vietnam, currently live in Milan, Italy. I am a software developer with strong iOS experience. I have learned the following softwares/languages/tools/technologies: – Operating systems: Mac OS X, Linux Ubuntu, Windows – Programming languages: Objective-C, C, C , C#, Python, Ruby, Java, Bash Script – Data exchange languages: JSON, XML – Versioning control systems: Git version control GitX – Database management systems: Sql Server, Sqlite3 – Integrated development environment: Xcode 3, Xcode 4, Eclipse, Visual Studio. – Application frameworks: Cocoa Touch, Google App Engine, Ruby on Rails, .net, Eclipse Graphical Modeling Framework, Eclipse Modeling Framework, J2ME, Django, DotNetNuke – Debugger tools: Xcode, gcc, gdb. – Editors: TextMate, Vi, Latex, Microsoft Word, Excel, Powerpoint, MarsEdit. – Image editing tools: Photoshop – Diagram editors: Omnigraffle Professional, Microsoft Visio – Blogging softwares: WordPress, Tumblr. – Web technologies: HTML, CSS, jQuery, XSLT, eXSLT, Firebug, Charles HTTP Debugger – Others: Crystal Report, Reporting Services. My profiles and websites: http://github.com/pnhoang http://twitter.com/pnhoang
Updated on September 17, 2022Comments
-
Hoang Pham over 1 year
I need to run the sqlite3 module on python 2.6 in an ubuntu system. How do I install this module for Python 2.6?
Somehow I don't have this module, it raises the error:
Python 2.6.5 (r265:79063, Mar 20 2010, 18:48:10) [GCC 4.4.1] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sqlite3 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/local/lib/python2.6/sqlite3/__init__.py", line 24, in <module> from dbapi2 import * File "/usr/local/lib/python2.6/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ImportError: No module named _sqlite3
-
Hoang Pham about 14 yearshi Cry, it is the same error. There is nothing changed. My ubuntu version is: Ubuntu 9.10 - the Karmic Koala - released in October 2009 and supported until April 2011.