Hi, I am using Ubuntu release 12.10 (quantum) 32-bit with Linux Kernel 3.5.0-21-generic. I am trying to get IPython History to work. I installed it using pythonbrew and a virtual environment. There I use pip to install IPython. Currently, when I run IPython in a terminal, I get:
WARNING: IPython History requires SQLite, your history will not be saved Python 2.7.3 (default, Nov 8 2012, 18:25:10) Type "copyright", "credits" or "license" for more information. IPython 0.13.1 -- An enhanced Interactive Python. ? -> Introduction and overview of IPython features. %quickref -> Quick reference. help -> Python own help system. object? -> Details about 'object', use 'object??' for extra details.
Searching for a warning in the first line, I found this release , so I went back and installed the following:
sudo apt-get install libsqlite0 libsqlite0-dev libsqlite3-0 libsqlite3-dev
and then uninstall and reinstall pysqlite using pip
pip uninstall pysqlite pip install pysqlite
After that, I decided to check the installation by importing the module:
Python 2.7.3 (default, Nov 8 2012, 18:25:10) [GCC 4.7.2] 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 "/home/me/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/sqlite3/__init__.py", line 24, in <module> from dbapi2 import * File "/home/me/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ImportError: No module named _sqlite3
So now the _sqlite3.so file seems impossible. This is when I found this SO question . Either it does not exist or it is not in my PYTHONPATH environment variable. File search, I get:
$ locate _sqlite3.so /home/me/Desktop/.dropbox-dist/_sqlite3.so /home/me/epd/lib/python2.7/lib-dynload/_sqlite3.so /usr/lib/python2.7/lib-dynload/_sqlite3.so
So there is a file, but when I looked at my python path:
import sys for p in sys.path: print p
none of the above paths containing _sqlite3.so were contained in my PYTHONPATH. For a giggle, I added the path / usr / lib / python 2.7 / lib-dynload to my PYTHONPATH in the terminal, and then tried to import sqlite3 again:
Python 2.7.3 (default, Nov 8 2012, 18:25:10) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import sys >>> sys.path.append("/usr/lib/python2.7/lib-dynload") >>> import sqlite3 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/home/me/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/sqlite3/__init__.py", line 24, in <module> from dbapi2 import * File "/home/me/.pythonbrew/pythons/Python-2.7.3/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module> from _sqlite3 import * ImportError: /usr/lib/python2.7/lib-dynload/_sqlite3.so: undefined symbol: PyUnicodeUCS4_DecodeUTF8
Oh oh Now I'm completely stuck. Can someone help me? I also read in several places that I might have to rebuild Python. I don't know how to do this in pythonbrew. Can someone point me in the right direction?