Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 14 Nov 2015 07:18:47 -0800
From:      Craig Rodrigues <rodrigc@FreeBSD.org>
To:        freebsd-python@freebsd.org
Subject:   Python3, ImportError: No module named '_sqlite3'
Message-ID:  <CAG=rPVe5fL82=VCsjL7=tqCyaLY7VoJYv46=intqYS0CJ0sOMA@mail.gmail.com>

next in thread | raw e-mail | index | archive | help
Hi,

I did the following on a FreeBSD 10.2 system:

pkg install lang/python35

python3.5 -c "import sqlite3"

and got this error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
ImportError: No module named 'sqlite'
[rodrigc@rodrigc-laptop1 portingdb]% python3.5 -c "import sqlite3"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python3.5/sqlite3/__init__.py", line 23, in <module>
    from sqlite3.dbapi2 import *
  File "/usr/local/lib/python3.5/sqlite3/dbapi2.py", line 27, in <module>
    from _sqlite3 import *
ImportError: No module named '_sqlite3'


For python2.7, I notice that this error is not there, because
the databases/py-sqlite3 port provides
/usr/local/lib/python2.7/lib-dynload/_sqlite3.so .

What is the workaround for Python 3.5?

Thanks.

--
Craig



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAG=rPVe5fL82=VCsjL7=tqCyaLY7VoJYv46=intqYS0CJ0sOMA>