LoginSignup
0
1

More than 1 year has passed since last update.

Linuxにpyenvをインストールしてpythonの開発環境を作る最短手順

Posted at

pyenvとpyenv updateをインストール

$ git clone git://github.com/yyuu/pyenv.git ~/.pyenv
$ git clone git://github.com/yyuu/pyenv-update.git ~/.pyenv/plugins/pyenv-update
$ pyenv update

~/.bashrcに下記を記述

# pyenv script
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"

eval "$(pyenv init -)"
  • .bashrcの変更を反映
$source ~/.bashrc

所望のバージョンのpythonをインストールして切り替える

$ pyenv install 3.9.6 
$ pyenv versions
* system
  3.9.6 (set by $HOME/.pyenv/version)

$ pyenv global 3.9.6
  system
* 3.9.6 (set by $HOME/.pyenv/version)
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