0
0

More than 3 years have passed since last update.

PyenvをCentOS7にインストールする

Last updated at Posted at 2021-08-14

pipenvを使いたかったのでここを参考した。
参考記事は少し古いからかうまくできない部分があったので、忘備録として残す

結局は1次情報であるgithubを見るのが早かった。

anacondaのPATHからの削除

anacondaをすでに入れていた人向け

~/.bashrcからanacondaのPATH追加部分を削除

pyenvのインストール

# 必要なライブラリを導入
sudo yum install -y git gcc zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel libuuid-devel xz-devel libffi-devel 

# pyenv を github から clone
git clone https://github.com/pyenv/pyenv.git ~/.pyenv

bashrc, bash_profileの編集

bash_profile
# デフォルトのbash_profileでは.bashrcを読み込む部分があるが、それより前に以下を挿入
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
~中略~
# 一番下に追記
eval "$(pyenv init --path)"
bashrc
# 一番下に追記(bashでコマンド補完するのに必要)
eval "$(pyenv init -)"

ログインし直せば完了

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