Raspberry Piとpyenv
当然Pythonを入れねばならない。Pythonならpyenvである。
git clone https://github.com/pyenv/pyenv.git $HOME/.pyenv
して.zshrcとかに
export PYENV_ROOT=${HOME}/.pyenv if [ -d ${PYENV_ROOT} ]; then export PATH=${PYENV_ROOT}/bin:$PATH export PYTHONPATH=./pyenv/python:$PYTHONPATH eval "$(pyenv init -)" fi
書いて
source ~/.zshrc
して
pyenv install 3.6.5
して終わり。とか思っていたが最後のインストールで躓いた。なぜだ。どうやらopenSSLがないかららしい。
必要なもの諸々を入れる。
sudo apt-get install -y git openssl libssl-dev libbz2-dev libreadline-dev libsqlite3-dev
これで問題なくインストールできる。
ちなみにbz2とreadlineがないとインストール後にWarningを食らう。こんな感じ↓
$ pyenv install 3.6.5 Downloading Python-3.6.5.tar.xz... -> https://www.python.org/ftp/python/3.6.5/Python-3.6.5.tar.xz Installing Python-3.6.5... WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib? WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?