How to install tensorflow with virtualenvwrapper on macOS-Sierra

拥有回忆 提交于 2019-12-23 04:24:09

问题


I need to install TensorFlow on macOS-Sierra and I want to use virtualenvwrapper for that. To install TensorFlow one could follow the virtualenv installation walk-through provided by TensorFlow website. However, I want to do that with virtualenvwrapper that can be installed like so.

Could someone who has experience with this guide me through?


回答1:


First I would install virtualenv and virtualenvwrapper:

$pip install virtualenv
$pip install virtualenvwrapper

Then I would create a directory for my virtualenvs.

$mkdir ~/.virtualenvs

Then I would update my .bashrc file:

#put these lines in your .bashrc file
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh

Then source .bashrc:

$source .bashrc

Then create my virtual environment:

$mkvirtualenv my-virtual-environment --system-site-packages target-directory

To activate the virtual environment and install tensorflow:

$workon my-virtual-environment
(my-virtual-environment)$pip install --upgrade tensorflow

I hope this helps. It's been a while since I've been a regular OSX user. If this doesn't work for you, keep this updated and I might be able to help more.



来源:https://stackoverflow.com/questions/45644224/how-to-install-tensorflow-with-virtualenvwrapper-on-macos-sierra

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!