在Anaconda上安装高于1.1.0的Tensorflow版本

时间:2018-03-02 05:37:45

标签: python tensorflow anaconda

我正在尝试安装Tensorflow 1.2.0或更高版本,因此我可以访问'feature_column'。

我尝试了很多东西来尝试更新它,但是没有成功。

我正在使用:

  

Mac OS X El Capitan V10.11.5

     

Anaconda 1.7.0版

     

python version 3.6.4

     

pip版本9.0.1

以下是我尝试的一些方法:

pip3 install --upgrade tensorflow

Failed to import the site module
Traceback (most recent call last):
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 544, in <module>
    main()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 530, in main
    known_paths = addusersitepackages(known_paths)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 282, in addusersitepackages
    user_site = getusersitepackages()
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 258, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site.py", line 248, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sysconfig.py", line 601, in get_config_var
    return get_config_vars().get(name)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sysconfig.py", line 550, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/sysconfig.py", line 421, in _init_posix
    _temp = __import__(name, globals(), locals(), ['build_time_vars'], 0)
ModuleNotFoundError: No module named '_sysconfigdata_x86_64_apple_darwin13_4_0'

当失败时我尝试了这个:

conda install -c conda-forge tensorflow

However, this only gave me the option to install Tensorflow version 1.1.0

是否有理由不让我安装1.2.0或更高版本?

2 个答案:

答案 0 :(得分:0)

我找到了解决方案:

conda install -c conda-forge google-api-python-client

允许Anaconda找到tensorflow的最新版本

然后升级tensorflow,我不得不首先将html5lib降级到版本0.9999999

答案 1 :(得分:0)

google-api-python客户端工作正常,但是tensorflow的版本仍然低于发布的版本,因为我得到张量流1.5但是1.6已经用完了。 以下代码对我有用:

pip install --ignore-installed --upgrade https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.6.0-py3-none-any.whl