How to install pysqlite?

I am trying to install pysqlite (Python interface for SQLite). I downloaded the package file (pysqlite-2.5.5.tar.gz). And I did the following:

gunzip pysqlite-2.5.5.tar.gz tar xvf pysqlite-2.5.5.tar \cd pysqlite-2.5.5 python setup.py install 

In the last step I have a problem. The following error message appears:

 error: command 'gcc' failed with exit status 1 

I found that other nations also encountered this problem .

As I understand it, a person had a problem because sqlite2 was not installed. But in my case, I have sqlite3 (I can run it from the command line).

Maybe I should change some paths in "setup.cfg" ? At the moment I have:

 #define= #include_dirs=/usr/local/include #library_dirs=/usr/local/lib libraries=sqlite3 define=SQLITE_OMIT_LOAD_EXTENSION 

And if I type "which sqlite3", I get:

 /usr/bin/sqlite3 

I saw a similar question here. The answer was "you need sqlite3-dev". But, even if it is, how to check if I have sqlite3-dev . And if I don’t have it, then how to get it?

Can anyone help me with this problem.

Thanks in advance.

+4
source share
10 answers

how to check if i have "sqlite3-dev"

It totally depends on which Linux distribution you use - Fedora, Suse, Ubuntu, Gentoo, Mandrake, or some other dozen; There are several packaging strategies and tools used to check which packages are available, get more, etc.

Therefore, never ask questions about checking, receiving, or configuring packages on Linux without specifying the [s] distribution of interest, which makes it impossible to provide exact, specific help.

Edit : the easiest way to find out details about your Linux distribution (works on all the ones that I have to try, but I don't have a particularly wide array ... ;-):

 $ cat /etc/*-release DISTRIB_CODENAME=hardy DISTRIB_DESCRIPTION="Ubuntu 8.04.2" DISTRIB_ID=Ubuntu DISTRIB_RELEASE=8.04 ...etc, etc... 

It will probably be the contents of the /etc/lsb-release file, but I suggest *-release , because I think there may be other similar files.

Of course, if the need to check your distribution is applied inside a file or program, reading this file (or files) and defining specific content will also be feasible; but in order to inform potential helpers about which distribution you are using, cat on the command line will be sufficient; -).

+3
source

For Debian distributions, I fixed this problem with

 sudo apt-get install libsqlite3-dev 
+8
source

I managed to solve the same build error by installing the sqlite-devel package:

 sudo yum install sqlite-devel 
+6
source

I had the same problem, I am using python 2.4, neither sqlite3-dev nor libsqlite3-dev are available for CentOS.

 yum install python-devel 

seems to solve the problem.

+4
source

What version of Python do you have? SQLite is integrated in Python since version 2.5:

http://docs.python.org/library/sqlite3.html

If you insist on compiling it, the package is called sqlite3-devel, you can find it, for example. here

+2
source

Instead, you can use yum or apt-get the first type:

  sudo yum(or apt-get) search python-sqlite3 

you will get something like python-sqlite3dbm.noarch

then enter:

  sudo yum(or apt-get) install python-sqlite3dbm.noarch 

this way, your os will install everything you need and you will not get errors

+2
source

I had the following compilation errors in the CentOS 5.6 release :

 src/cache.h:34: error: expected specifier-qualifier-list before 'PyObject_HEAD' src/cache.h:44: error: expected specifier-qualifier-list before 'PyObject_HEAD' src/cache.h:61: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pysqlite_NodeType' src/cache.h:62: error: expected '=', ',', ';', 'asm' or '__attribute__' before 'pysqlite_CacheType' src/cache.h:64: error: expected declaration specifiers or '...' before 'PyObject' src/cache.h:64: error: expected declaration specifiers or '...' before 'PyObject' src/cache.h:67: error: expected declaration specifiers or '...' before 'PyObject' src/cache.h:67: error: expected declaration specifiers or '...' before 'PyObject' 

Installing python-devel helped me too:

yum install python-devel

+1
source

I am the one who answered another question :) On systems that use RPM packages, i.e. you usually use "yum" to install things, the package is called sqlite3-devel.

On most Debian based systems (i.e. you use apt-get to install packages), the package is called sqlite3-dev.

This is a very typical difference between the two; most other packages follow the same naming convention.

0
source

I had the same issue with gcc crashing with Ubuntu Karmic. I fixed this by installing the python-dev package. In my case, I am working with python2.4, so I installed the python2.4-dev package. The python-dev package should work on python2.6.

0
source

Have you installed python sqlite lib?

 sudo apt-get install python-sqlite 
0
source

All Articles