1
2

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

macでpythonの環境を設定しなおす

Posted at

##狙い
bashやbrewを中途半端にいじった結果、自分の環境がわからなくなったため、最初からやり直します。

##環境
macOS Big Sur 11.0
Xcodeをインストール・アップデート済み
brewインストール済み

##ターミナルを整える
デフォルトシェルをzshにする
https://support.apple.com/ja-jp/guide/terminal/trml113/mac

##インストールしていく
以下をターミナルに打っていきます。
zsh brew install pyenv pyenv install 3.9.5 touch ~/.zshrc echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc echo 'eval "$(pyenv init -)"' >> ~/.zshrc echo -e 'if command -v pyenv 1>/dev/null 2>&1; then\n eval "$(pyenv init -)"\nfi' >> ~/.zshrc export PYENV_ROOT="$HOME/.pyenv" export PATH="$PYENV_ROOT/bin:$PATH" eval "$(pyenv init --path)" source ~/.zshrc pyenv install 3.9.5 pyenv global 3.9.5

##参考
https://prog-8.com/docs/python-env
https://blog.serverworks.co.jp/2021/05/12/233520

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?