I know there are already many people with this problem, but I've spent the last three hours going over every link I can find and I haven't been able to find a solution that works for me. I'm embarrassed to have to make this thread but I have no other option.
I've been doing Django with Tango, everything was running very smoothly until I got to this section: http://www.tangowithdjango.com/book/chapters/models.html#creating-and-synchronising-the-database
When doing the syncdb command, Python didn't recognize sqlite3. So I decided to verify this with a simple import test:
rob@rob-Latitude-E5400:~/code/tango_with_django_project$ python
Python 2.7.5 (default, Sep 21 2014, 16:23:05)
[GCC 4.6.3] 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/rob/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
from dbapi2 import *
File "/home/rob/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/sqlite3/dbapi2.py", line 27, in <module>
from _sqlite3 import *
ImportError: No module named _sqlite3
>>>
Lots of people had this same problem online. This guy
https://stackoverflow.com/a/1210746/694855
Gave some advice to find the _sqlite3.so, and put the directory in the PYTHONPATH. I ran the syncdb command again, and got this:
Traceback (most recent call last):
File "./manage.py", line 10, in <module>
execute_from_command_line(sys.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 453, in execute_from_command_line
utility.execute()
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 263, in fetch_command
app_name = get_commands()[subcommand]
File "/usr/local/lib/python2.7/dist-packages/django/core/management/__init__.py", line 109, in get_commands
apps = settings.INSTALLED_APPS
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 53, in __getattr__
self._setup(name)
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 49, in _setup
self._configure_logging()
File "/usr/local/lib/python2.7/dist-packages/django/conf/__init__.py", line 71, in _configure_logging
from django.utils.log import DEFAULT_LOGGING
File "/usr/local/lib/python2.7/dist-packages/django/utils/log.py", line 6, in <module>
from django.views.debug import ExceptionReporter, get_exception_reporter_filter
File "/usr/local/lib/python2.7/dist-packages/django/views/debug.py", line 11, in <module>
from django.http import (HttpResponse, HttpResponseServerError,
File "/usr/local/lib/python2.7/dist-packages/django/http/__init__.py", line 2, in <module>
from django.http.request import (HttpRequest, QueryDict, UnreadablePostError,
File "/usr/local/lib/python2.7/dist-packages/django/http/request.py", line 8, in <module>
from io import BytesIO
File "/home/rob/.pythonbrew/pythons/Python-2.7.5/lib/python2.7/io.py", line 51, in <module>
import _io
ImportError: /usr/lib/python2.7/lib-dynload/_io.so: undefined symbol: PyUnicodeUCS4_EncodeUTF32
Now I'm stuck. I Googled the last error and couldn't find much. Something about how my Python was compiled with a different Unicode. That doesn't tell me much on how to fix the problem though.
Thanks for reading and the help.