Skip to content

Instantly share code, notes, and snippets.

@kpedro88
Last active January 14, 2021 03:20
Show Gist options
  • Save kpedro88/6778398437d1885ab18f79d97f36c5eb to your computer and use it in GitHub Desktop.
Save kpedro88/6778398437d1885ab18f79d97f36c5eb to your computer and use it in GitHub Desktop.
Using htcondor python bindings in CMSSW_8_0_X

CMSSW_8_0_X cannot use the htcondor python bindings as installed using the system python in RHEL7 operating systems.

There is a method to install and use (automatically) the correct versions of the bindings. This can enable e.g. the use of manageJobs.py from CondorProduction. This method depends on scram-pip from lpc-scripts, which is available on cvmfs at /cvmfs/cms-lpc.opensciencegrid.org/FNALLPC/lpc-scripts/scram-pip.

Assuming you are in a CMSSW_8_0_X release area and have already done cmsenv, execute these bash commands:

HOME=$CMSSW_BASE python -m ensurepip --user
scram-pip -d $CMSSW_BASE/.local
cmsenv
HOME=$CMSSW_BASE pip install --no-cache-dir --user --upgrade pip
scram-pip -d $CMSSW_BASE/.local htcondor==$(condor_version | head -n 1 | cut -d' ' -f2) -p="--no-cache-dir"
cmsenv

Starting the python and pip commands with HOME=$CMSSW_BASE works around the lack of support for --prefix in ensurepip and older versions of pip. After executing these commands, $CMSSW_BASE/.local/lib/python2.7/site-packages will automatically be added to your $PYTHONPATH whenever you call cmsenv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment