LoginSignup
1
0

More than 1 year has passed since last update.

pythonをインストールした時に.profile と.zprofileが見つからないから作った

Posted at

問題

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

以上です。

1
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
1
0