LoginSignup
1
1

More than 5 years have passed since last update.

Pythonインストール

Last updated at Posted at 2017-04-06

事前準備

目的

deep learningを学習する環境を用意する

参考書籍:O'REILY ゼロから作るDeepLearning

要件

  • Python3系
  • NumPy
  • Matplotlib

  • 既にPython2.7が入っている為、別途3系をインストールする

Homebrewをインストール

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

pyenvをインストール

  • 下記コマンドでインストールする
brew install pyenv
  • インストール後バージョンを確認
pyenv -version

環境変数を通す

  • .bash_profileのファイルが存在するか確認しない場合は作成する
cd ~
ls -al
  • 上記コマンドで「.bash_profile」が存在しなければ下記コマンドより作成する
touch .bash_profile
  • 作成後にファイルを編集する
vi ~.bash_profile
export PATH="$HOME/.pyenv/shims:$PATH"
  • 編集後、変更内容を反映する
source ~/.bash_profile
  • パスが通っているか確認
which python

Pythonをインストール

  • インストール可能なバージョンを確認
pyenv install -l
  • インストールする
pyenv install 3.5.0
  • ※失敗した場合はXcodeコマンドライン用ツールをインストールする
xcode-select --install
  • 仕様するpythonのバージョンを指定する
pyenv global 3.5.0
  • pythonのバージョンを確認
python -v
  • Numpyをインストール
pip install numpy
  • Matplottlibをインストール
pip install matplotlib
1
1
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
1