- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall-python.sh
More file actions
Latest commit
executable file
·27 lines (20 loc) · 694 Bytes
/
Copy pathinstall-python.sh
File metadata and controls
executable file
·27 lines (20 loc) · 694 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
#!/bin/bash
# Version to install
PYTHON_VERSION=3.9.12
NB_CORES=$(nproc)
# Needed dependencies
apt update
apt -y install build-essential zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libssl-dev libsqlite3-dev libreadline-dev libffi-dev curl libbz2-dev liblzma-dev
# Get last python 3.9.x sources
curl -O https://www.python.org/ftp/python/$PYTHON_VERSION/Python-$PYTHON_VERSION.tar.xz
tar -xf Python-$PYTHON_VERSION.tar.xz &&cd Python-$PYTHON_VERSION
# Configure the compilation
./configure --enable-optimizations
# nb of core (exec nproc to know)
make -j $NB_CORES
make altinstall
# Clean files
cd .. && rm -rf Python-3.*
# Test install
python3.9 --version
echo"Install finished"