当前位置:  开发笔记 > 编程语言 > 正文

安装tensorflow时出错设置工具

如何解决《安装tensorflow时出错设置工具》经验,为你挑选了2个好方法。

我按照安装说明进行操作:https://www.tensorflow.org/versions/master/get_started/os_setup.html#pip_install

我在Mac OS X 10.11上使用python 2.7.11(Anaconda).我查了但是我的电脑上已经安装了setuptools 18.5.

并遇到了错误

sudo pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl
The directory '/Users/my_name/Library/Caches/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
The directory '/Users/my_name/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting tensorflow==0.6.0 from https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl
  Downloading https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl (10.2MB)
    100% |????????????????????????????????| 10.2MB 30kB/s 
Requirement already up-to-date: six>=1.10.0 in /Users/my_name/anaconda/lib/python2.7/site-packages/six-1.10.0-py2.7.egg (from tensorflow==0.6.0)
Collecting protobuf==3.0.0a3 (from tensorflow==0.6.0)
  Downloading protobuf-3.0.0a3.tar.gz (88kB)
    100% |????????????????????????????????| 90kB 2.7MB/s 
Requirement already up-to-date: wheel in /Users/my_name/anaconda/lib/python2.7/site-packages (from tensorflow==0.6.0)
Collecting numpy>=1.8.2 (from tensorflow==0.6.0)
  Downloading numpy-1.10.1.tar.gz (4.0MB)
    100% |????????????????????????????????| 4.1MB 77kB/s 
Collecting setuptools (from protobuf==3.0.0a3->tensorflow==0.6.0)
  Downloading setuptools-18.8.1-py2.py3-none-any.whl (463kB)
    100% |????????????????????????????????| 466kB 673kB/s 
Installing collected packages: setuptools, protobuf, numpy, tensorflow
  Found existing installation: setuptools 18.5
    Uninstalling setuptools-18.5:
      Successfully uninstalled setuptools-18.5
  Rolling back uninstall of setuptools
Exception:
Traceback (most recent call last):
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/pip/basecommand.py", line 211, in main
    status = self.run(options, args)
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/pip/commands/install.py", line 311, in run
    root=options.root_path,
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/pip/req/req_set.py", line 646, in install
    **kwargs
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/pip/req/req_install.py", line 803, in install
    self.move_wheel_files(self.source_dir, root=root)
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/pip/req/req_install.py", line 998, in move_wheel_files
    isolated=self.isolated,
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/pip/wheel.py", line 242, in move_wheel_files
    name, user=user, home=home, root=root, isolated=isolated
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/pip/locations.py", line 181, in distutils_scheme
    d = Distribution(dist_args)
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/setuptools/dist.py", line 269, in __init__
    for ep in pkg_resources.iter_entry_points('distutils.setup_keywords'):
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 729, in iter_entry_points
    entries = dist.get_entry_map(group)
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 2705, in get_entry_map
    self._get_metadata('entry_points.txt'), self
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 2448, in parse_map
    for group, lines in data:
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 3046, in split_sections
    for line in yield_lines(s):
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 2303, in yield_lines
    for ss in strs:
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 2630, in _get_metadata
    if self.has_metadata(name):
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 1626, in has_metadata
    return self.egg_info and self._has(self._fn(self.egg_info, name))
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 1984, in _has
    return zip_path in self.zipinfo or zip_path in self._index()
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 1864, in zipinfo
    return self._zip_manifests.load(self.loader.archive)
  File "/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg/pkg_resources/__init__.py", line 1804, in load
    mtime = os.stat(path).st_mtime
OSError: [Errno 2] No such file or directory: '/Users/my_name/anaconda/lib/python2.7/site-packages/setuptools-18.5-py2.7.egg'

Ujjwal.. 24

我有完全相同的问题(在Mac OS X 10.11上使用Python 2.7.11(Anaconda)).

添加--ignore-installed标志工作对我来说(如讨论这里).

$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl --ignore-installed

$ python
>>> import tensorflow


udibr.. 15

我在Ubuntu上有类似的错误

conda install -c https://conda.anaconda.org/anaconda setuptools

为我解决了这个问题



1> Ujjwal..:

我有完全相同的问题(在Mac OS X 10.11上使用Python 2.7.11(Anaconda)).

添加--ignore-installed标志工作对我来说(如讨论这里).

$ pip install --upgrade https://storage.googleapis.com/tensorflow/mac/tensorflow-0.6.0-py2-none-any.whl --ignore-installed

$ python
>>> import tensorflow



2> udibr..:

我在Ubuntu上有类似的错误

conda install -c https://conda.anaconda.org/anaconda setuptools

为我解决了这个问题

推荐阅读
地之南_816
这个屌丝很懒,什么也没留下!
DevBox开发工具箱 | 专业的在线开发工具网站    京公网安备 11010802040832号  |  京ICP备19059560号-6
Copyright © 1998 - 2020 DevBox.CN. All Rights Reserved devBox.cn 开发工具箱 版权所有