You need to install the Python module in the <python_dir> directory.
If you installed the Python module with the installation program (see Installation Manual), it will be located in the <python_dir>=<dependent_path>/runtime/python directory.
The Loader database tool contains a Python interpreter. Enter the following command to call the Python interpreter included with Loader:
<independent_program>/bin/x_python
This interpreter is set up to find the MaxDB module. If you are using the Python interpreter included with Loader, you do not need to follow the steps described below.
If you are not using the Loader version of the Python interpreter, then add the Python module to the search path of your Python interpreter: Use either of the following options to do this:
· Add <python_dir> to the PYTHONPATH environment variable.
Windows:
set
PYTHONPATH=%PYTHONPATH%;<python_dir>
Unix/Linux
(sh/bash):
PYTHONPATH=$PYTHONPATH:<python_dir>
export PYTHONPATH
· Create a text file called maxdb.pth, and add the single line <python_path>.Copy this file to a directory in the search path of the Python interpreter. The Python interpreter reads all files in the search path that have a *.pth extension. It then adds the directories contained in these files to its search path.
You can use the following program to view the search path of the Python interpreter.
import
sys
print sys.path
The installation contains modules for Python versions 1.5.2, 2.0, 2.1, 2.2 and 2.3. The appropriate module for your Python program is determined at runtime. This means that if you switch to another Python version, you do not need to modify the PYTHONPATH environment variable.
See also:
Database System Concepts, Variables and Examples