Python-OEChem is now provided in tar.gz format, which when un-tarred
creates a directory tree just like all other OpenEye applications. If
you already have an OpenEye tree, un-tar the Python distribution into
the same directory. If not, un-tarring will create an entire directory
structure starting with openeye
.
All the Python related code will be found under openeye/python
.
Next, you need to set an environment variable to allow Python to find
the Python-OEChem extensions. Inside the openeye/python
directory, there will be an examples directory and one or more directories
named for the platform, compiler and Python version. Here is an example
from a RedHat 9 installation. The distribution was un-tarred into
/usr/local
creating /usr/local/openeye
as the top
of the installation tree.
[user@crush local]$ ls openeye/python/ examples redhat-9.0-g++3.2-i586-python2.3 [user@crush local]$
We need to set the PYTHONPATH environment variable, for Python to locate
Python-OEChem. In your shell startup script (.bashrc for example) add the
following 2 lines. (The syntax may vary if you use a shell other than
bash
PYTHONPATH=/usr/local/openeye/redhat-9.0-g++3.2-i586-python2.3 export PYTHONPATH
Obviously, if you un-tarred in a different parent directory, you would use that actual location.
In order to lay the groundwork for end-user C++ OEChem modules, as well as Python wrappers around other OpenEye toolkits, that interoperate with Python-OEChem, as of version 1.3, Python-OEChem on most platforms now uses dynamic instead of static versions of the underlying OEChem C++ libraries. While this provides for great flexibility for future extension, it does create the added complexity of requiring the user to provide information to the run-time linker to find these shared libraries.
For most platforms, in order for shared libraries to work, we need to
set an additional environment variable. For most platforms, this
variable is LD_LIBRARY_PATH
. Presuming the same
directory tree as shown above, for Linux, Irix 6.5 and Tru64:
LD_LIBRARY_PATH=/usr/local/openeye/redhat-9.0-g++3.2-i586-python2.3:$LD_LIBRARY_PATH export LD_LIBRARY_PATH
For OS X, the variable is slightly different:
DYLD_LIBRARY_PATH=/usr/local/openeye/redhat-9.0-g++3.2-i586-python2.3:$DYLD_LIBRARY_PATH export DYLD_LIBRARY_PATH