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?

More than 3 years have passed since last update.

rapiにpyenv入れるときに詰まったはなし

Last updated at Posted at 2021-12-20

目的

raspiにpyenv入れるの時間かかったので記録に残しておく

目次

1.必要なパッケージのインストール
2.gitからpyenvをクローン
3.Pyenv用にシェルの環境を構成
4.実際にpythonのバージョンを変える

手順

1.必要なパッケージのインストール

この手順の前にaptやosの更新したので省略

コピー用
sudo apt install -y git openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev

2.gitからpyenvをクローン

正直readmeを読めば難なくインストールできます。
英語読めるひとはそっちが早いです。

コピー用
 git clone https://github.com/pyenv/pyenv.git ~/.pyenv

3.Pyenv用にシェルの環境を構成

~/.profile~/.bashrcを編集します。

~/.profile編集

この2行は~/.profileの前にあった方がいいっぽい

コピー用
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"

pyenv設定2.JPG

これは最後の行に

コピー用
eval "$(pyenv init --path)"

pyenv設定3.JPG

~/.bashrc編集

~/.bashrcの最後の行に

コピー用
eval "$(pyenv init -)

pyenv設定1.JPG

参考資料

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?