|
Before you can install PySQLite, you need to be sure your system has the Python interpreter and the development libraries installed, as well as a C compiler. You also need to have a SQLite development librarylibsqlite.so or sqlite.dllinstalled, as PySQLite does not include it. Some Linux distributions package the Python interpreter and development libraries separately, and simply selecting Python at install time may not have included the development package. On Red Hat Linux, for example, you need to make sure the python-devel package has been installed. Download the PySQLite source from http://sourceforge.net/projects/pysqlite/ and extract it. The version number in the filename may be different from that shown. $ gunzip -c pysqlite-0.5.1.tar.gz | tar xf - Enter the pysqlite directory that has been created and issue the following command to compile PySQLite: $ cd pysqlite $ python setup.py build running build running build_py creating build creating build/lib.linux-i686-2.3 creating build/lib.linux-i686-2.3/sqlite copying sqlite/__init__.py -> build/lib.linux-i686-2.3/sqlite copying sqlite/main.py -> build/lib.linux-i686-2.3/sqlite running build_ext building '_sqlite' extension [...] The following step installs the PySQLite extension into system directories and so you will need to become the root user, if you are not already, using the su command. # python setup.py install running install running build running build_py running build_ext running install_lib [...] To test that PySQLite has installed correctly, run the test suite that is shipped with the source code. The following output indicates a successful installation: # python tests/all_tests.py ................................................................................ .......................................... ---------------------------------------------------------------------- Ran 122 tests in 0.289s OK |
|