Skip to main content
Ask Question
Asked a question 6 years ago

How can I install the latest Python in Bright?

Where am I?

In Bright Computing, Inc. you can ask and answer questions and share your experience with others!

How can I install the latest Python in Bright?

RedHat, SUSE, and similar Linux-based OS distributors provide versions of Python that lag behind the latest upstream. This is normally a good thing, since the distributors provide integration, and carry out testing to make sure it works well with the rest of the OS. However, some admins would like to have the latest Python versions available on their cluster. One reason may be that later versions have some nicer features. 
Upgrading to the latest Python outside of what the distributors provide is not supported by the Linux distributors. So, it is possible to run into Python-related issues for which support cannot be provided by the distributors, and also not by us. Bright will of course help out within reason.
That said, upgrade-related issues have not been noticed. So there is a good chance that all works well.

The following steps were tested on a Bright 6.1 installation originally running Python 2.6. The steps are a guide to upgrading and recompiling Bright PythonCM with Python 3.4:

1. Download, extract, build Python 3.4.0:

# wget -c
# tar -xzvf Python-3.4.0.tgz
# cd Python-3.4.0
# ./configure --prefix=/opt/python/3.4.0 --enable-unicode=ucs4 --enable-shared
# make
# make install

2. Download, extract, build boost 1.55.0:

# wget -c
# tar -xjvf boost_1_55_0.tar.bz2
# cd boost_1_55_0
# echo "using python : 3.4 : /opt/python/3.4.0 :
/opt/python/3.4.0/include/python3.4m : /opt/python/3.4.0/lib ;" >> ./tools/build/v2/user-config.jam
# ./bootstrap.sh2 --with-python=/opt/python/3.4.0/bin/python3 --with-python-version=3.4 --with-python-root=/opt/python/3.4.0
# ./b2 --prefix=/opt/boost/1.55.0 --without-mpi --enable-unicode=ucs4 install

3. Extract the attached pythoncm archive and build it

# yumdownloader pythoncm-dist
# rpm2cpio pythoncm-dist-6.1-r20472_cm6.1.x86_64.rpm | cpio -idmv
# tar -xjvf pythoncm-6.1-r20472.tar.bz2
# cd pythoncm-6.1-r20472
# ./build.sh2 --with-boost=/opt/boost/1.55.0 --with-python-include=/opt/python/3.4.0/include/python3.4m --with-python-lib=/opt/python/3.4.0/lib/libpython3.so2
Compiled pythoncm revision: 20472
You have successfully built python
bindings for Bright Cluster Manager

Listing of files

# This is the Bright Computing Python Cluster Manager bindings build script
exec > >(tee pythoncm.src.build4.log)
exec 2> >(tee pythoncm.src.build4.err)
base=`dirname $0`
if [ "$base" = "." ]; then
echo $base
function on_exit() {
 if [ $? == 0 -a -f "$base/python/pythoncm.so2" ]; then
   export LD_LIBRARY_PATH="/opt/python/3.4.0/lib:./remotecm"
   echo "import sys" > pytest.py2
   echo "sys.path.insert(0, 'python')" >> pytest.py2
   echo "import pythoncm" >> pytest.py2
   echo "clustermanager = pythoncm.ClusterManager()" >> pytest.py2
   echo "print ('Compiled pythoncm revision: %s' % clustermanager.revision)" >> pytest.py2
   /opt/python/3.4.0/bin/python3 pytest.py2
   if [ $? == 0 ]; then
     echo "===================================="
     echo "You have successfully built python"
     echo "bindings for Bright Cluster Manager"
     echo "===================================="
     echo "===================================="
     echo "You have compiled pythoncm,"
     echo "but it was unable to execute properly"
     echo "===================================="
   echo "===================================="
   echo "pythoncm build failed!"
   echo "Check out the files:"
   echo "  pythoncm.src.build4.log"
   echo "  pythoncm.src.build4.err"
   echo "If the problem is not caused by missing"
   echo "packages (see README file) please send"
   echo "a mail to support@brightcomputing.com3"
   echo "and attach both pythoncm.src.build4 file"
   echo "===================================="
set -e
trap on_exit EXIT
CPUS=`grep -Eic "^processor" /proc/cpuinfo`
if [ -z "$CPUS" ]; then

# When compiling with a different version of pyhton make sure to also change the python pytest.py2 command above

./configure --with-gzip $*
make -j $CPUS