如何在macOS-Sierra上使用virtualenvwrapper安装Tensorflow [英] How to install tensorflow with virtualenvwrapper on macOS-Sierra
问题描述
我需要在macOS-Sierra上安装 TensorFlow ,并且我想为此使用 virtualenvwrapper . 要安装 TensorFlow ,可以遵循virtualenv 安装演练. ="nofollow noreferrer"> TensorFlow网站.但是,我想使用 virtualenvwrapper 来做到这一点,即可以像这样安装.
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?
推荐答案
首先,我将安装virtualenv和virtualenvwrapper:
First I would install virtualenv and virtualenvwrapper:
$pip install virtualenv
$pip install virtualenvwrapper
然后,我将为我的virtualenvs创建一个目录.
Then I would create a directory for my virtualenvs.
$mkdir ~/.virtualenvs
然后我将更新我的.bashrc文件:
Then I would update my .bashrc file:
#put these lines in your .bashrc file
export WORKON_HOME=~/.virtualenvs
source /usr/local/bin/virtualenvwrapper.sh
然后输入.bashrc来源:
Then source .bashrc:
$source .bashrc
然后创建我的虚拟环境:
Then create my virtual environment:
$mkvirtualenv my-virtual-environment --system-site-packages target-directory
要激活虚拟环境并安装tensorflow:
To activate the virtual environment and install tensorflow:
$workon my-virtual-environment
(my-virtual-environment)$pip install --upgrade tensorflow
我希望这会有所帮助.自从我成为OSX的常规用户已有一段时间了.如果这对您不起作用,请及时进行更新,我也许可以为您提供更多帮助.
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.
这篇关于如何在macOS-Sierra上使用virtualenvwrapper安装Tensorflow的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!