LoginSignup
0
1

More than 5 years have passed since last update.

ディレクトリ毎にTensorflow環境を構築する (fish対応)

Posted at

環境

  • macOS Sierra
  • fish shell(もちろん他のshellでもOK)
  • Python 3
  • Tensorflow 0.11.0
  • PyCharm

手順

pyenvでpythonをいれる

brew install pyenv
pyenv install 3.6.1
pyenv global 3.6.1
pyenv rehash

確認

pyenv versions
python --versions
which python

vertualenvでディレクトリごとの仮想環境をつくる

sudo pip install --upgrade virtualenv 
virtualenv --system-site-packages -p python3 targetDirectory
source .../targetDirectory/bin/activate.fish # bashの場合は bin/activate

確認

cd .../targetDirectory
python --versions
which python

tensorflowのインストール

cd .../targetDirectory
pip3 install --upgrade tensorflow     # for Python 3.n
pip3 install --upgrade tensorflow-gpu # for Python 3.n and GPU

確認

pip list

PyCharmで環境を指定する

preferences->project->project interpreterメニューを開き、右上のボタンから add local を選択し、targetDirectory/bin/python を指定する

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