Note: You might prefer to install a pre-compiled binary distribution of KInterbasDB if one is available for your platform.
|
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).
By default, KInterbasDB uses the DateTime
module of the
eGenix.com mx
Extensions to represent date and time values,
as recommended by the
Python DB API Specification.
However, it is not strictly necessary to use the mx.DateTime
module to handle dates and times.
See this FAQ.
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 otherwise 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.
On Windows, compilers other than Microsoft Visual C++ usually require some
library conversion to work with Python or Firebird.
With Firebird 1.5 and MinGW or Firebird 1.0 and Borland C++,
setup.py
will perform this conversion automatically. If the
automatic conversion fails, ensure that your compiler is installed properly
(especially that its bin
directory is in your PATH
).
For more information, see the
compiler-specific notes
in this document, as well as the
Section 6.2.2
of the Python standard library documentation on "Installing Python Modules".
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.
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:
Note for non-Windows platforms:
For example, RedHat-derived distributions such as Fedora split the
core Python distribution into
The use of C extensions to Python is quite common, so Python repackagers such as Linux distributions should include the files necessary to compile C extensions in their basic Python package. The Python core developers have noticed these repackaging mistakes and complained about them, but apparently without effect. |
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. |
LIBRARY CONVERSION ERROR |
The setup script's attempt to convert libraries intended for use with Microsoft Visual C++ into a format compatible with your compiler was not successful. Consult the compiler-specific notes in this document, as well as Section 6.2.2 of the Python standard library documentation on "Installing Python Modules". |
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 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
Note that KInterbasDB supports MinGW only with Firebird 1.5 or later, not Firebird 1.0 or Interbase®. With earlier versions of the database, use Microsoft Visual C++.
bin
subdirectory of the directory
where you installed MinGW is in your PATH.
python setup.py build --compiler=mingw32
During this step, the setup script moves the KInterbasDB package (including
the newly compiled C extensions) to the standard package directory
of your Python installation so that Python will be able to
import kinterbasdb
and import kinterbasdb.services
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 programmer rather than the Python interpreter anyway.
KInterbasDB has an extensive test suite (snapshots here), but it is not really intended for routine public use.
To verify that KInterbasDB is installed properly, switch to a directory
other than the temporary directory into which you decompressed the
source distribution (to avoid conflict between the copy of kinterbasdb
in that directory and the copy placed under the standard Python
site-packages
directory), then verify the importability of your
KInterbasDB installation by issuing the following command:
python -c "import kinterbasdb as k; print k.__version__"
If the import attempt does not encounter any errors and the version number is what you expected, 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 Forum.