[Tutor] sqlite3 import problem

Kushal Kumaran kushal.kumaran+python at gmail.com
Fri Jan 3 07:12:09 CET 2014


Matthew Ngaha <chigga101 at gmail.com> writes:

> im having problems importing sqlite3 on ubuntu python3.
>
>   File "/usr/local/lib/python3.3/sqlite3/__init__.py", line 23, in <module>
>     from sqlite3.dbapi2 import *
>   File "/usr/local/lib/python3.3/sqlite3/dbapi2.py", line 26, in <module>
>     from _sqlite3 import *
> ImportError: No module named '_sqlite3'
>
> i have that path and file (dbapi2.py). the problem is an import
> statement for _sqlite3. i don't see this file but shouldn't python3.3
> be able to import sqlite without errors? any suggestions? does anyone
> have _sqlite3.py in their   /usr/local/lib/python3.3/sqlite3/
> directory?

The /usr/local heirarchy is not used by official debian/ubuntu packages,
so other people will not have the same contents in there as you.  You
must have a locally built python in /usr/local.  Check the build logs if
it has complained about not being able to build the sqlite3 module.  If
so, you can install all build dependencies for the offical python3
package by running this command:

# apt-get build-dep python3

And then rebuilding your local python3 installation.

-- 
regards,
kushal
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 489 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/tutor/attachments/20140103/09a2d6cb/attachment.sig>


More information about the Tutor mailing list