...
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:
Info | ||
---|---|---|
| ||
Be aware of your environment settings before and after testing your Python applications. |
source /usr/local/lcls/tools/script/go_python2.7.13.bash
Code Block | |||||||
---|---|---|---|---|---|---|---|
| |||||||
| 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
...
fi # Set default Java to 64-bit |
...
export JAVA_HOME=${LCLS_ROOT}/package/java/jdk1.8.0_144 |
...
if [ -z `echo "${PATH}" | grep "${JAVA_HOME}/bin"` ]; then |
...
export PATH=${JAVA_HOME}/bin:${PATH} |
...
fi
...
fi if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${JAVA_HOME}/lib"` ]; then |
...
export LD_LIBRARY_PATH=${JAVA_HOME}/lib:${LD_LIBRARY_PATH} |
...
fi
...
fi # Set default Qt to 64-bit for PyQwt and PyQt4 compatibility |
...
export QT_HOME=${LCLS_ROOT}/package/Qt/Qt-4.8.6/linux-x86_64 |
...
if [ -z `echo "${PATH}" | grep "${QT_HOME}/bin"` ]; then |
...
export PATH=${QT_HOME}/bin:${PATH} |
...
fi
...
fi if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${QT_HOME}/lib"` ]; then |
...
export LD_LIBRARY_PATH=${QT_HOME}/lib:${LD_LIBRARY_PATH} |
...
fi
...
fi # Set default Oracle client to 11.2.0.2.0 64-bit for cx_Oracle compatibility |
...
export ORACLE_HOME=${LCLS_ROOT}/package/oracle/product/11.2.0.2.0_x86_64/client_1 |
...
if [ -z `echo "${PATH}" | grep "${ORACLE_HOME}/bin"` ]; then |
...
export PATH=${ORACLE_HOME}/bin:${PATH} |
...
fi
...
fi if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${ORACLE_HOME}/lib"` ]; then |
...
export LD_LIBRARY_PATH=${ORACLE_HOME}/lib:${LD_LIBRARY_PATH} |
...
fi
...
fi # Set default Matlab to 2016b 64-bit for matlab_wrapper compatibility |
...
if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${LCLS_ROOT}/matlab/2016b/extern/lib"` ]; then |
...
export LD_LIBRARY_PATH=${LCLS_ROOT}/matlab/2016b/extern/lib:${LD_LIBRARY_PATH} |
...
fi
...
fi # Set default EPICS to 64-bit for pyca and psp compatibility |
...
if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${EPICS_BASE_RELEASE}/lib/linux-x86_64"` ]; then |
...
export LD_LIBRARY_PATH=${EPICS_BASE_RELEASE}/lib/linux-x86_64:${LD_LIBRARY_PATH} |
...
fi
...
fi if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${EPICS_EXTENSIONS}/lib/linux-x86_64"` ]; then |
...
export LD_LIBRARY_PATH=${EPICS_EXTENSIONS}/lib/linux-x86_64:${LD_LIBRARY_PATH} |
...
fi
...
fi if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${EPICS_BASE_TOP}/base-cpp-R4-6-0/lib/linux-x86_64"` ]; then |
...
export LD_LIBRARY_PATH=${EPICS_BASE_TOP}/base-cpp-R4-6-0/lib/linux-x86_64:${LD_LIBRARY_PATH} |
...
fi
...
fi # Set default Python to 2.7.13 64-bit |
...
export PYTHON_ROOT=${LCLS_ROOT}/package/python/python2.7.13/linux-x86_64 |
...
if [ -z `echo "${PATH}" | grep "${PYTHON_ROOT}/bin"` ]; then |
...
export PATH=${PYTHON_ROOT}/bin:${PATH} |
...
fi
...
fi if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${PYTHON_ROOT}/lib"` ]; then |
...
export LD_LIBRARY_PATH=${PYTHON_ROOT}/lib:${LD_LIBRARY_PATH} |
...
fi
...
fi if [ -z `echo "${LD_LIBRARY_PATH}" | grep "${PYTHON_ROOT}/build/Python2.7.13/Lib"` ]; then |
...
export LD_LIBRARY_PATH=${PYTHON_ROOT}/build/Python2.7.13/Lib:${LD_LIBRARY_PATH} |
...
fi
# Clear existing $PYTHONPATH
...
fi # Clear existing $PYTHONPATH 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:
...
- Add the previous Python instance to your environment:
export PYTHON_ROOT=${LCLS_ROOT}/package/python/python2.7.4
- Add the previous Python binaries to your environment:
export PATH=${PYTHON_ROOT}/bin:${PATH}
- Add the old Python libraries and their dependencies to your environment:
export LD_LIBRARY_PATH=${} - [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} - [Optional] $QT_HOME
- [Optional] Matlab
...