pyenvのインストール
Python をコンパイルするために必要なライブラリをインストール
code:console
$ sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev \
xz-utils tk-dev libffi-dev liblzma-dev git
libcurses5-dev は libcurses-dev の方がいいかも?
git がないと pyenv-installer が動かないので追加。
code:console
$ curl https://pyenv.run | bash
以下のようなメッセージが出てくるので、~/.bash_profile に追加。
code:console
# Load pyenv automatically by appending
# the following to
~/.bash_profile if it exists, otherwise ~/.profile (for login shells)
and ~/.bashrc (for interactive shells) :
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
# Restart your shell for the changes to take effect.
# Load pyenv-virtualenv automatically by adding
# the following to ~/.bashrc:
eval "$(pyenv virtualenv-init -)"
code:~/.bash_profile
export PYENV_ROOT="$HOME/.pyenv"
command -v pyenv >/dev/null || export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init -)"
参考
https://github.com/pyenv/pyenv
https://bgasparotto.com/install-pyenv-ubuntu-debian