...
- From an internet-accessible machine, download the latest Python 2.7.x source tarball (https://www.python.org/downloads/source/)
Create the Python installation directory structure in LCLS production: $PACKAGE_TOP/python/python<version> (e.g., $PACKAGE_TOP/python/python2.7.13),
which should look as follows:Code Block language bash theme Midnight $ ls /usr/local/lcls/package/python/python2.7.13/linux-x86_64 bin include lib man share src
Transfer the Python source tarball to $PACKAGE_TOP/python/python<version>/src:
Code Block language bash theme Midnight $ ls /usr/local/lcls/package/python/python2.7.13/linux-x86_64/src Python-2.7.13.tgz
Configure the build with the following options:
Anchor bootstrap_pip bootstrap_pip Info --prefix=$PACKAGE_TOP/python/python2.7.13/linux-x86_64 (To create all build directories under the current structure)
--enable-shared (To allow building of shared libraries [.so files], required for packages such as PyQt)
--with-ensurepip=upgrade (To bootstrap the latest pip installer for Python 2.7.x >= 2.7.9)Code Block language bash theme Midnight $ ./configure --prefix=$PACKAGE_TOP/python/python2.7.13/linux-x86_64 --enable-shared --with-ensurepip=upgrade $ make $ make install
Set the environment to use the newly-installed Python instance (example uses a script):
Code Block language bash theme Midnight $ cat go_python2.7.13.bash
#!/bin/bash
# Sets the user environment to use Python2.7.13
thenif [ -d /afs/slac/g/lcls ];
exportthen export LCLS_ROOT=/afs/slac/g/lcls
else
exportelse export LCLS_ROOT=/usr/local/lcls
fi
export ORACLE_HOME=${LCLS_ROOT}/package/oracle/product/11.2.0.2.0_x86_64/client_1
export QT_HOME=${LCLS_ROOT}/package/Qt/Qt-4.8.6/linux-x86_64
export PYTHON_ROOT=${LCLS_ROOT}/package/python/python2.7.13/linux-x86_64
export PATH=${QT_HOME}/bin:${ORACLE_HOME}/bin:${PYTHON_ROOT}/bin:${PATH}
export LD_LIBRARY_PATH=${EPICS_BASE_RELEASE}/lib/linux-x86_64:${EPICS_EXTENSIONS}/lib/linux-x86_64:${EPICS_BASE_TOP}/base-cpp-R4-6-0/lib/linux-x86_64:${QT_HOME}/lib:${ORACLE_HOME}/lib:${PYTHON_ROOT}/lib:${PYTHON_ROOT}/build/Python2.7.13/Lib:${LD_LIBRARY_PATH}
$ source go_python2.7.13.bash
Check that the core installation includes pip and setuptools (required for building Python modules from source):
Code Block language bash theme Midnight $ pip list pip (9.0.1) setuptools (28.8.0)
...