-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompile_python_sqlite.sh
27 lines (23 loc) · 1.15 KB
/
compile_python_sqlite.sh
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
#!/bin/bash
#set current python version here !
PYTHON_VERS=3.8.1
PYTHON_VERS_SHORT=3.8
cd ~
sudo apt-get update -y
sudo apt-get install build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
wget https://www.python.org/ftp/python/$PYTHON_VERS/Python-$PYTHON_VERS.tar.xz
tar xf Python-$PYTHON_VERS.tar.xz
cd Python-$PYTHON_VERS
./configure --enable-optimizations --enable-loadable-sqlite-extensions
make -j 4
sudo make altinstall
cd ..
sudo rm -r Python-$PYTHON_VERS
rm Python-$PYTHON_VERS.tar.xz
#install update-alternatives
sudo update-alternatives --install /usr/local/bin/python3 python3 /usr/local/bin/python$PYTHON_VERS_SHORT 1
echo "choose python $PYTHON_VERS_SHORT if you want to set it as default. Otherwise exit with CTRL+C"
sudo update-alternatives --config python3
#sudo apt-get --purge remove build-essential tk-dev libncurses5-dev libncursesw5-dev libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev libffi-dev -y
#sudo apt-get autoremove -y
#sudo apt-get clean