Python#

Installation#

The central, AFS-based installation of Python provides a number of handy features for monitoring dCache and the other CMS services.#

Packages Provided#

psycopg2#

psycopg is a Python interface to the PostgreSQL database.#

Installation#

The module depends on the PostgreSQL libraries; since it is distributed via AFS, it’s inefficient and troublesome to compile it dynamically. Statically building the psycopg C extensions requires a few small tweaks.#

First, temporarily move the libpq.so shared libraries out of the way.#

# cd /usr/local/pgsql/lib/
# mkdir so-tmp
# mv libpq.so* so-tmp/.

Then, add crypt, resolv, and nsl to the psycopg setup.py script. After modification, the relevant part should look like so:#

     71 class psycopg_build_ext(build_ext):
    ...
    143     def finalize_options(self):
    144         """Complete the build system configuation."""
    145         build_ext.finalize_options(self)
    146 
    147         self.include_dirs.append(".")
    148         self.libraries.append("crypt")
    149         self.libraries.append("resolv")
    150         self.libraries.append("nsl")
    151         self.libraries.append("pq")
    152 

Then, build and install the module as normal:#

# /afs/hep.wisc.edu/cms/sw/python-2.5/bin/python setup.py install