Last active
June 9, 2023 05:28
-
-
Save heiwa4126/cf04ac83b77a3f535e5ecf788f86d9d0 to your computer and use it in GitHub Desktop.
AWS CloudShell(とAmazon Linuix 2)にPython 3.9をインストールする。 https://computingforgeeks.com/how-to-install-python-on-amazon-linux/ をアレンジ
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo yum -y groupinstall "Development Tools" | |
sudo yum -y install openssl-devel bzip2-devel libffi-devel xz-devel jq | |
curl https://www.python.org/ftp/python/3.9.9/Python-3.9.9.tar.xz -O | |
tar xf Python-3.9.9.tar.xz | |
cd Python-3.9.9 | |
./configure --enable-optimizations | |
sudo make altinstall | |
cd .. | |
sudo rm -rf Python-3.9.9 Python-3.9.9.tar.xz | |
sudo /usr/local/bin/python3.9 -m pip install --upgrade pip | |
pip3.9 install -U -user yq | |
python3.9 --version | |
pip3.9 --version | |
# gccが古いと --enable-optimizations オプションをつけると `Could not import runpy module`で死ぬかもしれない | |
# readline-develがないと、>>>でヒストリ等が効かない。用途によってアレンジ | |
# 最新版は https://www.python.org/ftp/python/ から探して。 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
jqとyqはオマケ。