0
0

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 5 years have passed since last update.

Python3 - Pyenvを使ったインストール方法 - Mac

Posted at

sudoの設定

$ sudo hoge
# ルート権限でコマンド(hoge)を実行できる. パスワードが聞かれるが, それには 自分のパスワードを答える。
$ sudo -s
# プロンプトが # に変わり, exit するまでルートのままでいられる.
$ sudo -u (ユーザ名) (コマンド or -s)
-u オプションを付けてユーザ名を指定すると, 指定したユーザ権限でコマンドが実行できる.

Homebrewのインストール

# 手順
# 以下をターミナルにペースト
sh -c "$(curl -fsSL https://raw.githubusercontent.com/Linuxbrew/install/master/install.sh)"
# 上手くいかないときは、
$ sudo xcode-select --install

pythonのversion変更

pyenvのインストール

手順
# terminal上で
git clone https://github.com/yyuu/pyenv.git ~/.pyenv  OR brew install pyenv
export PATH=$PATH:$PYENV_ROOT/bin
export PYENV_ROOT="$HOME/.pyenv"
eval "$(pyenv init -)"
# インストールできるpythonのversionを確認
# terminal上でinstall可能なver. をチェック
pyenv install -l
# 特定のver.をinstall
pyenv install (pythonのver.)
# installされた利用可能なver.の確認
pyenv versions
# 利用ver.の設定
# 全体で
pyenv global (利用したいpython のver.)
# 特定のディレクトリで
pyenv local (利用したいpython のver.)
# 正しく動作させるためにShimsの更新
pyenv rehash
# passを通す
vi ~/.bash_profile
0
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
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?