0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

install pyenv/python systemwide on Rocky 9.4

Last updated at Posted at 2024-09-22

initial setting for linux

useradd

sudo useradd <name>
sudo passwd <name>

install pyenv

download

sudo su -
cd /usr/local

dependencies

dnf install gcc make patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel

dnf install git
git clone https://github.com/pyenv/pyenv.git pyenv

set login profile

/etc/profile.d/pyenv.sh
echo 'export PYENV_ROOT="/usr/local/pyenv"' >> /etc/profile.d/pyenv.sh
echo '[[ -d $PYENV_ROOT/bin ]] && export PATH="$PYENV_ROOT/bin:$PATH"' >> /etc/profile.d/pyenv.sh
echo 'eval "$(pyenv init - --no-rehash)"' >> /etc/profile.d/pyenv.sh

--no-rehashは次のブログを参考に追記した

check

再ログインする

exec -l $SHELL
pyenv -v

install python for system

dependencies

dnf install gcc make patch zlib-devel bzip2 bzip2-devel readline-devel sqlite sqlite-devel openssl-devel tk-devel libffi-devel xz-devel

python

pyenv install --list
pyenv install 3.9.

これで3.9.Xの候補一覧が出る

pyenv install 3.9.20
pyenv global 3.9.20

check

一般ユーザにて

exec -l $SHELL
python -V

→3.9.20となる

0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?