0
3

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.

MacでPython環境の構築

Posted at

はじめに

最近(いやとっくに)流行りのPython。
機械学習や高度な数値計算のライブラリが豊富にあるため今後も伸びそうな予感です。
俺も俺もということで、学びの環境を構築して行こうと思います。
素のPythonと、多数の科学計算パッケージを含んだanaconda両方いれていきます
(どっちかで良いけど今回は勉強も兼ねて)

作業の流れ

  1. homebrewのインストール(今回はここは割愛)
  2. homebrewでpyenvインストール
  3. pyenvでanacondaインストール

pyenv

インストール

$brew install pyenv

パスを通す(bashなら.bash_profile)

$echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.zshrc
$echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.zshrc
$echo 'eval "$(pyenv init -)"' >> ~/.zshrc
$source ~/.zshrc

anaconda

# install可能なversion確認
$pyenv install -l | grep anaconda
$pyenv install anaconda3-5.0.0

素のPython(3.6.3)を入れる

$pyenv install 3.6.3

アクティブにするPythonのverisonを切り替える

# アクティブなversion確認
$pyenv versions
  system
* 3.6.3 (set by /Users/user/.pyenv/version)
  anaconda3-5.0.0
# version切替
$pyenv global anaconda3-5.0.0
アクティブなversion確認
$pyenv versions
  system
  3.6.3
* anaconda3-5.0.0 (set by /Users/user/.pyenv/version)

おわりに

セットアップ完了です。
結構サクッといくね。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?