Mac Anaconda中安装TensorFlow,解决新环境spyder打不开的问题

看了很多教程,走了很多弯路,Anaconda卸了重装,终于搞好了,分享一下自己的做法。

1、安装Anaconda

此步省略介绍

2、创建新环境

// 创建环境
conda create -n tensorflow python=3.6

3、安装tensorflow

// 激活环境
source activate tensorflow
// 安装Tensorflow
python -m pip install tensorflow -i https://pypi.douban.com/simple

按照上述操作后,spyder打不开了,报错:

Traceback (most recent call last):
  File "/Users/qiaoyiran/anaconda3/bin/spyder", line 4, in 
    import spyder.app.start
  File "/Users/qiaoyiran/anaconda3/lib/python3.6/site-packages/spyder/app/start.py", line 22, in 
    from spyder.config.main import CONF
  File "/Users/qiaoyiran/anaconda3/lib/python3.6/site-packages/spyder/config/main.py", line 22, in 
    from spyder.config.user import UserConfig
  File "/Users/qiaoyiran/anaconda3/lib/python3.6/site-packages/spyder/config/user.py", line 26, in 
    from spyder.utils.programs import check_version
  File "/Users/qiaoyiran/anaconda3/lib/python3.6/site-packages/spyder/utils/programs.py", line 18, in 
    import subprocess
  File "/Users/qiaoyiran/anaconda3/lib/python3.6/subprocess.py", line 136, in 
    import _posixsubprocess
ImportError: dlopen(/Users/qiaoyiran/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so, 2): Symbol not found: __Py_set_inheritable_async_safe
  Referenced from: /Users/qiaoyiran/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so
  Expected in: flat namespace
 in /Users/qiaoyiran/anaconda3/lib/python3.6/lib-dynload/_posixsubprocess.cpython-36m-darwin.so

解决办法在github上面找到了解决方法,需要

Mac Anaconda中安装TensorFlow,解决新环境spyder打不开的问题_第1张图片

4、遂在新建的环境中试用,报错说没有这个包,于是先install 再update,之后再install spyder ,成功!

//install
conda install python.app

//update
conda update python.app

 

你可能感兴趣的:(Anaconda,TensorFlow,Mac,anaconda,tensorflow,Mac,Spyder)