Exception: Versioning for this project requires either an sdist tarball,问题解决方法

[root@localhost ~]# python
Python 2.7.5 (default, Aug  4 2017, 00:39:18) 
[GCC 4.8.5 20150623 (Red Hat 4.8.5-16)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import tensorflow as tf
Traceback (most recent call last):
  File "", line 1, in 
  File "/usr/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in 
    from tensorflow.python import *
  File "/usr/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 114, in 
    from tensorflow.python.platform import test
  File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/test.py", line 60, in 
    import mock                # pylint: disable=g-import-not-at-top,unused-import
  File "/usr/lib/python2.7/site-packages/mock/__init__.py", line 2, in 
    import mock.mock as _mock
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 71, in 
    _v = VersionInfo('mock').semantic_version()
  File "/usr/lib/python2.7/site-packages/pbr/version.py", line 461, in semantic_version
    self._semantic = self._get_version_from_pkg_resources()
  File "/usr/lib/python2.7/site-packages/pbr/version.py", line 448, in _get_version_from_pkg_resources
    result_string = packaging.get_version(self.package)
  File "/usr/lib/python2.7/site-packages/pbr/packaging.py", line 755, in get_version
    name=package_name))
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also pup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.

解决方法:

sudo pip install --upgrade distribute
执行有问题使用下面方法

pip install --upgrade tensorflow_gpu




你可能感兴趣的:(机器学习)