Difference between revisions of "Python Install Methods"
Jump to navigation
Jump to search
| (3 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
| + | # Installing Python From Source | ||
| + | |||
| + | Debian | ||
| + | ``` | ||
| + | #!/usr/bin/env bash | ||
| + | set -e pipefail | ||
| + | |||
| + | version='3.9.6' | ||
| + | |||
| + | get() { | ||
| + | sudo apt install -y build-essential checkinstall | ||
| + | sudo apt install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev \ | ||
| + | libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev | ||
| + | |||
| + | curl -LO https://www.python.org/ftp/python/$version/Python-$version.tgz | ||
| + | tar xzf Python-$version.tgz | ||
| + | } | ||
| + | |||
| + | install() { | ||
| + | cd Python-$version | ||
| + | ./configure --prefix=/usr/local | ||
| + | #./configure --prefix=/usr/local --enable-optimizations | ||
| + | sudo make altinstall | ||
| + | } | ||
| + | |||
| + | get | ||
| + | install | ||
| + | ``` | ||
| + | |||
| + | |||
| + | |||
## Install Python 3.7 from source on Centos 7 | ## Install Python 3.7 from source on Centos 7 | ||
``` | ``` | ||
| Line 14: | Line 45: | ||
``` | ``` | ||
| − | + | ## Setup Virtual Environment for 3.7 | |
``` | ``` | ||
| − | python3.7 -m venv | + | python3.7 -m venv venv3.7 |
| − | source | + | source venv3.7/bin/activate |
pip install -U pip wheel # if needed | pip install -U pip wheel # if needed | ||
``` | ``` | ||
Latest revision as of 20:22, 1 July 2021
Installing Python From Source
Debian
#!/usr/bin/env bash
set -e pipefail
version='3.9.6'
get() {
sudo apt install -y build-essential checkinstall
sudo apt install -y libreadline-gplv2-dev libncursesw5-dev libssl-dev \
libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev libffi-dev zlib1g-dev
curl -LO https://www.python.org/ftp/python/$version/Python-$version.tgz
tar xzf Python-$version.tgz
}
install() {
cd Python-$version
./configure --prefix=/usr/local
#./configure --prefix=/usr/local --enable-optimizations
sudo make altinstall
}
get
install
Install Python 3.7 from source on Centos 7
#!/usr/bin/env bash set -eo pipefail version='3.7.7' yum -y install gcc openssl-devel zlib-devel wget make wget https://www.python.org/ftp/python/$version/Python-$version.tgz tar xzf Python-$version.tgz cd Python-$version ./configure --prefix=/usr/local #./configure --prefix=/usr/local --enable-optimizations make altinstall
Setup Virtual Environment for 3.7
python3.7 -m venv venv3.7 source venv3.7/bin/activate pip install -U pip wheel # if needed