在mac上装一个tensorflow做一些小的实验还是蛮方便的。用virtualenv的方式避免了很多麻烦。
sudo pip install --upgrade virtualenv
virtualenv --system-site-packages tensorflow
pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.7.1-py2-none-any.whl
但是在运行的时候发现报错:
from matplotlib.backends import _macosx
RuntimeError: Python is not installed as a framework. The Mac OS X backend will not be able to function correctly if Python is not installed as a framework. See the Python documentation for more information on installing Python as a framework on Mac OS X. Please either reinstall Python as a framework, or try one of the other backends. If you are Working with Matplotlib in a virtual enviroment see ‘Working with Matplotlib in Virtual environments’ in the Matplotlib FAQ
解决的方法也很简单:
vim ~/.matplotlib/matplotlibrc
然后输入以下内容:
backend: TkAgg
本文介绍如何在Mac上使用virtualenv安装TensorFlow,并解决了在运行过程中遇到的matplotlib后端错误问题。通过修改matplotlib配置文件指定使用TkAgg后端来规避此问题。
582

被折叠的 条评论
为什么被折叠?



