-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-python3.sh
More file actions
executable file
·30 lines (27 loc) · 945 Bytes
/
install-python3.sh
File metadata and controls
executable file
·30 lines (27 loc) · 945 Bytes
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
v=3.7.2
py_url=https://www.python.org/ftp/python/$v/Python-$v.tar.xz
tar_name=$(basename $py_url)
dir_name=~/local/Python-$v
echo "Downloading $tar_name from python.org..."
wget $py_url 2>/dev/null
echo "Untarring $tar_name..."
tar Jxf $tar_name
echo "Relocating it to $dir_name"
mkdir -p $dir_name
rm -f $tar_name
mv Python-$v ~/local
cd $dir_name
echo "Now configuring it to be installed locally."
./configure --prefix=$dir_name 1>/dev/null
echo "Compiling Python-$v with -j 40."
make -j 40 &>/dev/null
echo "Building binaries with -j 40."
make install -j 40 &>/dev/null
echo "Linking Python and Pip binaries to ~/bin."
mkdir -p ~/bin
cd ~/bin
ln -s $dir_name/bin/python${v:0:1} python${v:0:1}
ln -s $dir_name/bin/pip${v:0:1} pip${v:0:1}
echo "You will want to prepend PATH with ~/bin to use this Python install."
echo "Edit your ~/.bashrc with 'export PATH=~/bin:\$PATH'."
echo "Then, run install-packages.sh to grab NetworkX and others."