-
Notifications
You must be signed in to change notification settings - Fork 0
/
install_python2.7.8
executable file
·50 lines (41 loc) · 1.25 KB
/
install_python2.7.8
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!/bin/bash
#
# Taken from https://gist.github.com/jaberg/6251456/, updated for 2016.
#
# USAGE
# -----
#
# Run this script in the folder (not $HOME, try ~/python) where you want to put
# the Python libraries.
#
# To access the installed Python environment, start a fresh shell and source the
# fake_venv.sh file (e.g., ". ~/python/fake_venv.sh").
#
# If other Python packages that require compilation are used in this
# environment, they might need to be recompiled with GCC.
# Configure bash
set -x # Verbose
set -e # Exit on error
module unload python gcc intel openmpi mkl
module load gcc
# Install Python
PYTHON_NAME=Python-2.7.8
PREFIX="${HOME}/.python2.7.8"
echo "Install in ${PREFIX}"
rm -rf ${PREFIX}
mkdir -p ${PREFIX}
wget "http://python.org/ftp/python/2.7.8/${PYTHON_NAME}.tgz"
tar zxvf ${PYTHON_NAME}.tgz
(cd ${PYTHON_NAME} \
&& ./configure --prefix=${PREFIX} --enable-shared \
&& make \
&& make install)
# Install Pip
# This is not required last installed (Feb 06, 2017)
# wget https://bitbucket.org/pypa/setuptools/raw/bootstrap/ez_setup.py -O - | python
wget https://bootstrap.pypa.io/get-pip.py
${PREFIX}/bin/python get-pip.py
# # Install some common packages
# for pkg in cython ipython numpy scipy matplotlib h5py; do
# pip install ${pkg}
# done