Note: If you are using a mainstream operating system and you have no particular reason for building KInterbasDB from source, you might prefer to install a pre-compiled binary distribution.
|
KInterbasDB requires a valid combination of the dependencies in the list below.
Detailed instructions on how to install each dependency are beyond the scope of this document; consult the dependency distributor for installation instructions.
Satisfying the dependencies is not difficult! For mainstream operating systems--including Windows and Linux--easily installable binary distributions are available for all of KInterbasDB's dependencies (see the download links below).
KInterbasDB uses the DateTime module of the eGenix.com mx Extensions to represent date and time objects, as recommended by the Python DB API Specification.
Once you have successfully installed the dependencies, you may proceed with the installation of KInterbasDB itself.
Beginning with version 3.0, KInterbasDB has full support for the
distutils
,
the standard facility for Python package distribution and installation.
Full instructions for using the distutils are available
here,
but you can skip them unless you have an insoluble problem.
Open a command prompt, change to the directory where you decompressed the
kinterbasdb source distribution, and type:
python setup.py build
The installation script, setup.py
, will attempt to
automatically detect the information
needed by the C compiler; then it will invoke the distutils to perform the
actual compilation. If you installed automatic distributions of the
dependencies that place themselves in standard locations (on UNIX-style
operating systems)
or record their locations in the system registry (on Windows),
the compilation should proceed without incident.
If setup.py
raises no errors and its output concludes with
something like "Creating library...
", then you are
ready to proceed to the next step.
If you receive an error message, examine its contents and then consult the following table:
Error Message Header | Explanation |
LIBRARY AUTODETECTION ERROR |
The setup script was unable to automatically find one or more files needed for the compilation process, such as a library needed by the C compiler.
If you are using Python 1.5.2 on Windows, this error message will
always be raised when you first run the KInterbasDB setup
script in a freshly decompressed source distribution.
Python 1.5.2 lacks the
Using a text editor, you will need to manually specify the relevant
paths in the
If manually specifying the library paths fails to solve the
problem:
Linux-specific note:
If you are attempting to use the RPM distribution of the eGenix
package and kinterbasdb's setup script (as well as Python in
general) cannot find it, you may need to move the eGenix package
from
This problem has only been reported on Mandrake Linux, but probably
affects other RPM-based distributions also. It should be noted that
the eGenix package itself has very good |
COMPILER CONFIGURATION ERROR |
The setup script could not function because of the current configuration of your compiler. The error message should provide details about what went wrong, and perhaps a suggestion of how to fix the problem. If you are not using the standard compiler for your platform, consult the compiler-specific notes. |
PYTHON SYSTEM ERROR |
Your Python installation is outdated, lacks some crucial modules,
or is otherwise inadequate.
The error message will indicate what your options are, which
may include installing a more recent Python version, compiling
additional C extension modules for your current Python version,
or editing |
KINTERBASDB DISTRIBUTION ERROR |
The setup script cannot find a file that was supposed to be included with the KInterbasDB source distribution. Try downloading the KInterbasDB source distribution again and decompressing it into a fresh temporary directory, then repeat the compilation step. |
LIBRARY MANUAL SPECIFICATION ERROR |
One of the library paths specified in
If you had no particular reason to manually specify the library
path in the first place, try commenting out that entry
in |
If the problem persists after you have followed the advice in the error message itself and in the table above, visit the KInterbasDB Help Forum and report your problem.
vcvars32.bat
batch file from
the bin
subdirectory of your Visual C++
installation.C:\Program Files\Microsoft Visual Studio\VC98\bin
python setup.py build
In order to compile KInterbasDB automatically with the Borland
compiler,
you must use version 1.0.2 or later of the Python distutils
.
Python 2.2 includes the required version. If you must use a
version of Python before 2.2, you
can
update
the distutils
package independently of your Python
version, or just compile manually.
bin
subdirectory of the directory
where you installed the Borland compiler is in your PATH.C:\Borland\bcc55\bin
python setup.py build --compiler=bcpp
See Section 3.1.2 of the Python standard documentation chapter "Installing Python Modules".
During this step, the setup script moves the KInterbasDB package (including
the newly compiled C extension module) to the standard package directory
of your Python installation so that Python will be able to
import kinterbasdb
.
In addition to the Python code and shared library files actually used by the Python interpreter, the setup script typically installs some supporting files, such as documentation. Depending on your system configuration, these supporting files may be placed in the same directory or a different directory from the files used by the Python interpreter.
Run the following command:
python setup.py install
The setup script will install KInterbasDB, listing each file it installs.
Errors during this step are rare because compilation
(the finicky part of this process) has already taken place; installation
is really just a matter of copying files. However, there will be file
system permission errors if the Python installation directory is not
writable by the user running the setup script. If you encounter such an
error, try one of the following:
- Log in as a user who has the required file system permissions and repeat
the installation step.
- Manually copy the directory
build/lib.platform-pyver/kinterbasdb
(which contains the Python modules and compiled library files created
during the compilation step) to a directory in your PYTHONPATH. This
approach will not install the supporting files, but they are for the benefit
of the KInterbasDB client programmer rather than the Python interpreter
anyway.
A test suite is planned for a future version of KInterbasDB, but it was not written in time for version 3.0.
In the meantime, switch to a directory
other than the temporary directory into which you decompressed the
source distribution (to avoid conflict between the
kinterbasdb.py
in that directory and the copy placed under the
standard Python site packages directory),
then verify the integrity of your KInterbasDB installation by
issuing the following command:
python -c "import kinterbasdb"
If the import attempt does not encounter any errors, you are finished. Next, consider reading the KInterbasDB Usage Guide.
You should not encounter any errors at this stage since you have already completed the compilation and installation steps successfully. If you do, please report them to the KInterbasDB Help Forum.