問題
Pythonをmacに入れました。
プロゲート が分かりやすかったです。
https://prog-8.com/docs/python-env
しかし、最後にバージョンが3.7.5になりませんでした。
pyenv global 3.7.5
python --version
→Python 2.7.16
。。。?
調べたら
pyenv init
をすると
# (The below instructions are intended for common
# shell setups. See the README for more guidance
# if they don't apply and/or don't work for you.)
# Add pyenv executable to PATH and
# enable shims by adding the following
# to ~/.profile and ~/.zprofile:
export PYENV_ROOT="$HOME/.pyenv"
export PATH="$PYENV_ROOT/bin:$PATH"
eval "$(pyenv init --path)"
# Load pyenv into the shell by adding
# the following to ~/.zshrc:
eval "$(pyenv init -)"
# Make sure to restart your entire logon session
# for changes to profile files to take effect.
とでますのでそれに従いましたが、
~/.profileと~/.zprofileが見つかりませんでした。
解決
~の場所でファイルを作り
touch .profile
touch .zprofile
それを読み込ませる
source ~/.profile
source ~/.zprofile
すると、成功しました!
pyenv global 3.7.5
python --version
→Python 3.7.5
以上です。