Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Software
User Name
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.


  Search this Thread
Old 01-14-2009, 03:35 PM   #1
LQ Newbie
Registered: Jan 2009
Posts: 5

Rep: Reputation: 0
Apparent gcc error when building pysqlite

Dear all,

I'm something of a n00b, so please be gentle.

I'm running Ubuntu 8.04

I've got sqlite3 installed, but I keep getting errors when trying trying to install pysqlite (2.4.1 or 2.5.1).

If I run
$ python build
things look like they're going ok for a while, but then I soon start getting errors:

running build
running build_py
running build_ext
building 'pysqlite2._sqlite' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -DMODULE_NAME="pysqlite2.dbapi2" -I/usr/local/include /usr/bin -I/usr/include/python2.5 -c src/module.c -o build/temp.linux-i686-2.5/src/module.o
In file included from src/module.c:24:
src/connection.h:26:20: error: Python.h: No such file or directory
There's a whole load more stuff, ending up with:

src/module.c:303: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘init_sqlite’
error: command 'gcc' failed with exit status 1

gcc -v tells me that gcc exists so I think that last error must be a red herring. However, after searching the web and trying lots of things, I've not managed to build pysqlite.

In case it's relevant, setup.cfg contains the following (after attempts at various things having tried following up on some suggestions I found posted elsewhere):


I'd be very grateful to anyone who has any suggestions. Again, I'm a newbie so please keep that in mind.

Many thanks,
Old 01-14-2009, 03:41 PM   #2
ReliaFree Maintainer
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
You are missing the Python development files
src/connection.h:26:20: error: Python.h: No such file or directory
. On a binary distro like Ubuntu, they are named something like Python-dev or Python-devel. Use your pacakge manager to find the right package.
Old 01-14-2009, 03:50 PM   #3
LQ Newbie
Registered: Jan 2009
Posts: 5

Original Poster
Rep: Reputation: 0

I've now build and installed pysqlite just fine.

Many many thanks. I'm very happy now!
Old 01-14-2009, 03:58 PM   #4
LQ Newbie
Registered: Jan 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Ugh! Ok, so it built and installed, but now I'm getting a new problem when I try to run a simple Python script that uses pysqlite:

Traceback (most recent call last):
File "", line 1, in <module>
from pysqlite2 import dbapi2 as sqlite
File "/usr/lib/python2.5/site-packages/pysqlite2/", line 27, in <module>
from pysqlite2._sqlite import *
ImportError: /usr/lib/python2.5/site-packages/pysqlite2/ undefined symbol: sqlite3_enable_load_extension

So I guess I'm missing something else from my Python installation. Once more, any help will be appreciated. Please let me know if I should be asking this sort of stuff elsewhere.



Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
i have an error Building GCC: requires GMP 4.1+ and MPFR 2.3.0+. robineecc1 Linux From Scratch 17 03-05-2018 06:57 AM
Error building cross gcc-3.3.2 for i386-mingw32msvc target ugenn Linux - Software 2 10-05-2012 03:33 AM
one more error building GCC - related with the newer version of Glibc?? lfs63 Linux From Scratch 1 02-17-2008 10:20 AM
error in Building gcc-4.0.2 newcomer4 Linux - Software 2 01-31-2006 03:44 AM
Error building GCC Lunar_Lamp Linux From Scratch 1 01-18-2006 06:30 AM > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 04:54 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration