【发布时间】:2018-06-26 22:56:37
【问题描述】:
我有一个全新的 Anaconda 安装 (Python 3.6),我正在尝试在 Mac OS X High Sierra 上通过 pip 安装 tensorflow(如 here 所述)。
具体来说,我已经跑过:
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/
我怀疑这可能是 pip 问题而不是 tensorflow 问题,但一直未能找到解决方案。非常欢迎任何帮助!
【问题讨论】:
-
好像写和读都不行。你可以试试
sudo pip install -
感谢您的建议。
sudo pip选择根环境,我想在单独的环境中执行此操作。另外,sudo是否推荐与 conda 一起使用? -
似乎
html5lib是唯一的源包 - 您可以尝试通过conda install -c anaconda html5lib单独安装它,以避免使用setuptools从源代码构建它,然后重试安装命令。 -
谢谢@hoefling。按照您的建议安装了
html5lib,但似乎仍然出现相同的错误。出于某种原因,当我在原始消息中运行pip install命令时,它仍然尝试安装html5lib? -
现在正在运行
conda list html5lib我看到以下html5lib 1.0.1 py36h2f9c1c0_0 anaconda html5lib 0.9999999 <pip>
标签: python tensorflow pip anaconda conda