繁体   English   中英

在Anaconda中使用pip安装Tensorflow失败

[英]Installing tensorflow using pip within anaconda fails

我有一个新的安装蟒蛇(Python的3.6),我试图通过PIP安装tensorflow(如描述这里在Mac OS X高塞拉利昂)。

具体来说,我已经运行:

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

输出如下:

Collecting tensorflow==1.4.1 from https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.4.1-py3-none-any.whl
      Using cached https://storage.googleapis.com/tensorflow/mac/cpu/tensorflow-1.4.1-py3-none-any.whl
    Collecting six>=1.10.0 (from tensorflow==1.4.1)
      Using cached six-1.11.0-py2.py3-none-any.whl
    Collecting wheel>=0.26 (from tensorflow==1.4.1)
      Using cached wheel-0.30.0-py2.py3-none-any.whl
    Collecting numpy>=1.12.1 (from tensorflow==1.4.1)
      Using cached numpy-1.14.0-cp36-cp36m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
    Collecting protobuf>=3.3.0 (from tensorflow==1.4.1)
      Using cached protobuf-3.5.1-py2.py3-none-any.whl
    Collecting tensorflow-tensorboard<0.5.0,>=0.4.0rc1 (from tensorflow==1.4.1)
      Using cached tensorflow_tensorboard-0.4.0rc3-py3-none-any.whl
    Collecting enum34>=1.1.6 (from tensorflow==1.4.1)
      Using cached enum34-1.1.6-py3-none-any.whl
    Collecting setuptools (from protobuf>=3.3.0->tensorflow==1.4.1)
      Using cached setuptools-38.4.0-py2.py3-none-any.whl
    Collecting html5lib==0.9999999 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.1)
      Using cached html5lib-0.9999999.tar.gz
    Collecting markdown>=2.6.8 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.1)
      Using cached Markdown-2.6.11-py2.py3-none-any.whl
    Collecting bleach==1.5.0 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.1)
      Using cached bleach-1.5.0-py2.py3-none-any.whl
    Collecting werkzeug>=0.11.10 (from tensorflow-tensorboard<0.5.0,>=0.4.0rc1->tensorflow==1.4.1)
      Using cached Werkzeug-0.14.1-py2.py3-none-any.whl
    Building wheels for collected packages: html5lib
      Running setup.py bdist_wheel for html5lib ... done
      Running setup.py clean for html5lib
    Failed to build html5lib
    Installing collected packages: six, wheel, numpy, setuptools, protobuf, html5lib, markdown, bleach, werkzeug, tensorflow-tensorboard, enum34, tensorflow
      Running setup.py install for html5lib ... error
        Complete output from command /Users/mcewen/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/Users/mcewen/pip-build-r4d_y_ei/html5lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record ./pip-62mbr8ng-record/install-record.txt --single-version-externally-managed --compile:
        running install
        running build
        running build_py
        creating build
        creating build/lib
        creating build/lib/html5lib
        copying html5lib/inputstream.py -> build/lib/html5lib
        copying html5lib/sanitizer.py -> build/lib/html5lib
        copying html5lib/constants.py -> build/lib/html5lib
        copying html5lib/html5parser.py -> build/lib/html5lib
        copying html5lib/__init__.py -> build/lib/html5lib
        copying html5lib/ihatexml.py -> build/lib/html5lib
        copying html5lib/tokenizer.py -> build/lib/html5lib
        copying html5lib/utils.py -> build/lib/html5lib
        creating build/lib/html5lib/filters
        copying html5lib/filters/_base.py -> build/lib/html5lib/filters
        copying html5lib/filters/sanitizer.py -> build/lib/html5lib/filters
        copying html5lib/filters/inject_meta_charset.py -> build/lib/html5lib/filters
        copying html5lib/filters/__init__.py -> build/lib/html5lib/filters
        copying html5lib/filters/alphabeticalattributes.py -> build/lib/html5lib/filters
        copying html5lib/filters/optionaltags.py -> build/lib/html5lib/filters
        copying html5lib/filters/lint.py -> build/lib/html5lib/filters
        copying html5lib/filters/whitespace.py -> build/lib/html5lib/filters
        creating build/lib/html5lib/treewalkers
        copying html5lib/treewalkers/_base.py -> build/lib/html5lib/treewalkers
        copying html5lib/treewalkers/pulldom.py -> build/lib/html5lib/treewalkers
        copying html5lib/treewalkers/genshistream.py -> build/lib/html5lib/treewalkers
        copying html5lib/treewalkers/__init__.py -> build/lib/html5lib/treewalkers
        copying html5lib/treewalkers/lxmletree.py -> build/lib/html5lib/treewalkers
        copying html5lib/treewalkers/etree.py -> build/lib/html5lib/treewalkers
        copying html5lib/treewalkers/dom.py -> build/lib/html5lib/treewalkers
        creating build/lib/html5lib/serializer
        copying html5lib/serializer/htmlserializer.py -> build/lib/html5lib/serializer
        copying html5lib/serializer/__init__.py -> build/lib/html5lib/serializer
        creating build/lib/html5lib/treebuilders
        copying html5lib/treebuilders/_base.py -> build/lib/html5lib/treebuilders
        copying html5lib/treebuilders/etree_lxml.py -> build/lib/html5lib/treebuilders
        copying html5lib/treebuilders/__init__.py -> build/lib/html5lib/treebuilders
        copying html5lib/treebuilders/etree.py -> build/lib/html5lib/treebuilders
        copying html5lib/treebuilders/dom.py -> build/lib/html5lib/treebuilders
        creating build/lib/html5lib/treeadapters
        copying html5lib/treeadapters/sax.py -> build/lib/html5lib/treeadapters
        copying html5lib/treeadapters/__init__.py -> build/lib/html5lib/treeadapters
        creating build/lib/html5lib/trie
        copying html5lib/trie/_base.py -> build/lib/html5lib/trie
        copying html5lib/trie/datrie.py -> build/lib/html5lib/trie
        copying html5lib/trie/__init__.py -> build/lib/html5lib/trie
        copying html5lib/trie/py.py -> build/lib/html5lib/trie
        running install_lib
        running install_egg_info
        running egg_info
        writing html5lib.egg-info/PKG-INFO
        writing dependency_links to html5lib.egg-info/dependency_links.txt
        writing requirements to html5lib.egg-info/requires.txt
        writing top-level names to html5lib.egg-info/top_level.txt
        reading manifest file 'html5lib.egg-info/SOURCES.txt'
        writing manifest file 'html5lib.egg-info/SOURCES.txt'
        removing '/Users/mcewen/anaconda3/lib/python3.6/site-packages/html5lib-0.9999999-py3.6.egg-info' (and everything under it)
        Copying html5lib.egg-info to /Users/mcewen/anaconda3/lib/python3.6/site-packages/html5lib-0.9999999-py3.6.egg-info
        running install_scripts
        writing list of installed files to './pip-62mbr8ng-record/install-record.txt'
        error: [Errno 2] No such file or directory: './pip-62mbr8ng-record/install-record.txt'

        ----------------------------------------
    Command "/Users/mcewen/anaconda3/bin/python -u -c "import setuptools, tokenize;__file__='/Users/mcewen/pip-build-r4d_y_ei/html5lib/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record ./pip-62mbr8ng-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /Users/mcewen/pip-build-r4d_y_ei/html5lib/

我怀疑这可能是一个小问题,而不是张量流问题,但是还没有找到解决方案。 任何帮助都非常欢迎!

我也在Mac上安装tensorflow时遇到很多问题。

最终,我以这种方式做到了,并且成功了:我遵循了来自tensorflow站点的命令,但是工作不正常。

另外,在同一站点上,可以使用sudo。

  1. 转到Ananconda Navigator,单击Environments(左侧菜单),然后在子菜单上单击Create按钮。 输入名称(“ Tensorflow”将是我的选择)
  2. 在右侧较大的框架中,从下拉列表中选择All,在Search文本框中输入tensorflow,然后将出现一些tensorflow项目。
  3. 选择tensorflow,单击右下角的Apply。

注意:现在我有两个环境,“ root”和“ tensorflow”。 我在点击Python IDE(Spyder)之前选择tensorflow。

不确定这是否是您要找的东西: anaconda-navigator-tensorflow-install

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM