0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

【AWS】EC2に新しいVersionのPythonをインストール

Last updated at Posted at 2024-07-06

EC2で下記を実行する。

sudo yum remove -y openssl-devel
sudo yum install -y openssl11 openssl11-devel
wget -c https://www.python.org/ftp/python/3.10.14/Python-3.10.14.tar.xz
tar -Jxvf Python-3.10.14.tar.xz
cd Python-3.10.14/
sudo yum install gcc
./configure --enable-optimizations
make
sudo make install

python3で実行可能なようにシンボリックリンクを作成する

sudo rm /usr/bin/python3   # 既存リンクがあれば削除
sudo ln -s /usr/local/bin/python3.10 /usr/bin/python3
python3 --version

pip3も同様に。

sudo rm /usr/bin/pip3   # 既存リンクがあれば削除
sudo ln -s /usr/local/bin/pip3.10 /usr/bin/pip3
pip3 -V
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?