Some background: we have a codebase written in Python 3 that uses Pyramid and the SqlAlchemy ORM to persist to a mysql database. To write tests for our classes using the ORM
You are missing the sqlite3 Python module, which you can verify with:
bin/python -c 'import sqlite3'
The which sqlite3 command only shows you have the sqlite3 command line tool installed; this is not what Python uses. It uses the libsqlite3 shared library (which the command line tool also uses). If missing, it means Python was not able to find the SQLite development headers when you built Python.
On Ubuntu, you need to install libsqlite3-dev to get those headers.
You may be missing other dependencies; on Ubuntu I'd install:
libreadline6-dev
libbz2-dev
libssl-dev
libsqlite3-dev
libncursesw5-dev
libffi-dev
libdb-dev
libexpat1-dev
zlib1g-dev
liblzma-dev
libgdbm-dev
libmpdec-dev
Some of these are accelerator packages; Python will work without them but some modules will be slower (e.g. decimal without the mpdecimal library).
You may want to verify the Ubuntu Python 3.4 source package dependencies for your Ubuntu version.