Python 2.5, Sqlite, and the obvious
by Jeremy Jones
Traceback (most recent call last):
File "manage.py", line 2, in
from django.core.management import execute_manager
ImportError: No module named django.core.management
After digging for a few minutes, I realized that I didn't have the Sqlite header files on my system when I compiled Python. I added the libsqlite-dev package on my laptop (which is running Ubuntu), did the make && make install dance, and tried it again. No error.
Had I taken the time to read all 1291 lines of the README in the Python 2.5 release, I would have read this around line 760:
Building the sqlite3 module
To build the sqlite3 module, you'll need the sqlite3 or libsqlite3
packages installed, including the header files. Many modern operating
systems distribute the headers in a separate package to the library -
often it will be the same name as the main package, but with a -dev or
The version of pysqlite2 that's including in Python needs sqlite3 3.0.8
or later. setup.py attempts to check that it can find a correct version.
Now all is well with the world.
|Why should we care for the fact that you had problems that could have been avoided if you had read the README file ? Why do you think the file is called README and not DISREGARDME ?|
Thanks for the posting Jeremy. I actually do enjoy honest and real life examples like the one you posted. Sometimes if your in the thick of things and you really need to get something running you don't have time to read 1,500 lines of documentation several times per day, and you wing it by hoping you can fix any problems with intuition and luck. Keep up the good work and real life example postings. I find them refreshing as many people don't have the guts to be honest when posting technical articles.
|Thanks for the kind words, Noah. I feel like a blog is a good place to be transparent. That includes sometimes blogging stupid mistakes and hopefully prevent others folks from falling into the same trap. Hope all is well with your Django and Python 2.5. I haven't hit any problems yet, save the non-problem mentioned above.|
|What's make && make install dance, and exactly what steps did you take to solve your problem?|
|Jeremy M. Jones
|Oh, believe me I have problems today (that's two years later!) setting up Django and SQLite. I'm a Ruby on Rails fan, though I was using Python before that. One day I decided to see how Django compared, but after the pain of seeing manual installs of Django, Python-SQLite, and Python-MySQL fail, I don't have time to waste. I really wish Guido would champion a package system like RubyGems, so I wouldn't have to putt around with manual builds that freaking fail.|