You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 11 Next »

EED Systems Group is working on upgrading the default Python instance in the LCLS production environment from Python 2.7.4 32-bit to Python 2.7.13 64-bit.

All Python applications in use in LCLS production must be tested and verified against the updated version before changing the default version of Python.

Testers can use the following environment settings to properly test their applications against Python 2.7.13:

Configuring LCLS production environment for testing

Method 1

If you would like full control over your user environment settings, use the following instructions.

Notes

The following instructions assume that you are using the Bash shell, and that ${LCLS_ROOT}=/usr/local/lcls. Steps 1-4 are required.

  1. Add the new Python instance to your environment:

    export PYTHON_ROOT=${LCLS_ROOT}/package/python/python2.7.13/linux-x86_64

  2. Add the new Python binaries to the PATH environment variable:

    export PATH=${QT_HOME}/bin:${ORACLE_HOME}/bin:${PYTHON_ROOT}/bin:${PATH}

  3. Add the new Python libraries and their dependencies (EPICS 64-bit, Matlab, etc.) to the LD_LIBRARY_PATH environment variable. This is to ensure that the new 64-bit versions of Python modules built against those dependencies will work:

    export LD_LIBRARY_PATH=${LCLS_ROOT}/matlab/2016b/extern/lib:${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:${PYTHON_ROOT}/lib:${PYTHON_ROOT}/build/Python2.7.13/Lib:${LD_LIBRARY_PATH}

  4. Clear the PYTHONPATH environment variable. This is to ensure that there are no false positives when testing applications, since PYTHONPATH may still have access to older versions of Python modules:

    export PYTHONPATH=
  5. [Optional] If your application(s) import the "cx_Oracle" module, add/change the following in your environment:

    export PATH=${ORACLE_HOME}/bin:${PATH}

    export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}

  6. [Optional] If your application(s) import "PyQt", "PyQwt", or any other Python modules that depend on Qt, add/change the following in your environment:

    export QT_HOME=${LCLS_ROOT}/package/Qt/Qt-4.8.6/linux-x86_64

    export PATH=${QT_HOME}/bin:${PATH}

    export LD_LIBRARY_PATH=${QT_HOME}/lib:${LD_LIBRARY_PATH}

Method 2

If you would like to use the full Python 2.7.13 64-bit environment and all of its dependencies, source the following setup script, which does all of the steps in Method 1, including the optional ones:

source /usr/local/lcls/tools/script/go_python2.7.13.bash

Note

The script above may introduce duplicate paths into your environment settings. Be aware of your environment settings before and after testing your Python applications.

#!/bin/bash

# Sets the user environment to use Python2.7.13

 

if [ -d /afs/slac/g/lcls ]; then

        export LCLS_ROOT=/afs/slac/g/lcls

else

        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=${LCLS_ROOT}/matlab/2016b/extern/lib:${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}

export PYTHONPATH=

Workarounds

After testing, it may be discovered that certain applications may not run with Python 2.7.13 64-bit due to unresolved/conflicting dependencies (e.g., 32-bit Python modules, Matlab2016b, Qt5, etc.) or other reasons. If such dependencies cannot currently be resolved, Python developers may invoke the following environment settings in a wrapper script or similar to launch the application using the older instance of Python instead:

Notes

The following instructions assume that you are using the Bash shell, and that ${LCLS_ROOT}=/usr/local/lcls.

  1. Add the previous Python instance to your environment:

    export PYTHON_ROOT=${LCLS_ROOT}/package/python/python2.7.4

  2. Add the previous Python binaries to your environment:


    export PATH=${PYTHON_ROOT}/bin:${PATH}
  3. Add the old Python libraries and their dependencies to your environment:

    export LD_LIBRARY_PATH=${}

  4. [Optional] $ORACLE_HOME

    export ORACLE_HOME=package/oracle/product/11.1.0.6/client
    export PATH=${ORACLE_HOME}/bin:${PATH}
    export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH}


  5. [Optional] $QT_HOME
  6. [Optional] Matlab



 

 

  • No labels