通过virtualenv安装tensorflow之后,手动打开IDLE引入tensorflow会出现报错:不识别tensorflow, 解决办法是通过virtualenv来启动IDLE,方法如下:
1)先激活virtualenv:
在/Users/C_Ronaldo/targetDirectory/bin目录下:
source activate
(如需关闭可用deactivate)
2) 运行python-m idlelib.idle
如此便可以打开IDLE,然后新建文件,import tensorflow as tf 没毛病。
3)装scipy库:
https://www.scipy.org/install.html#individual-packages,步骤:
进入虚拟Python环境:source activate
python -m pip install --upgrade pip
修改# Consider adding this at the end of your ~/.bash_profile file export PATH="$PATH:/Users/your_user/Library/Python/3.5/bin"
Replace your_user with your username, and “3.5” with your Python version.
然后
pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
4)解决报错找不到imread,解决方案:
pip install Pillow==3.4.2