[Tutor] Ubuntu 14.04 + Python 3.4.1 (pyvenv) + sqlite3

Juan Christian juan0christian at gmail.com
Thu Sep 25 21:30:49 CEST 2014


So, I'm coding a software using Flask and sqlite3 on Ubuntu 14.04, I read
that on Python 3.4.1, sqlite3 is default, but when I try to 'import
sqlite3' I get:

Traceback (most recent call last):
  File "flaskr.py", line 5, in <module>
    import sqlite3
  File "/usr/local/lib/python3.4/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.4/sqlite3/dbapi2.py", line 26, in <module>
    from _sqlite3 import *
ImportError: No module named '_sqlite3'


I'm running this code in a virtualenv using pyvenv.

pip list (inside venv):
Flask (0.10.1)
itsdangerous (0.24)
Jinja2 (2.7.3)
MarkupSafe (0.23)
pip (1.5.6)
requests (2.4.1)
setuptools (5.8)
Werkzeug (0.9.6)

Using Python 3.4.1


The code is question is an example code from Flask doc, here:
http://flask.pocoo.org/docs/0.10/tutorial/dbinit/#tutorial-dbinit

I already installed 'libsqlite3-dev' (apt-get). I don't knwo what to do!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20140925/bc59c0e4/attachment.html>


More information about the Tutor mailing list