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

Posted 武睿傲雪

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了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 "<stdin>", line 1, in <module>
  File "/usr/lib/python2.7/site-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/usr/lib/python2.7/site-packages/tensorflow/python/__init__.py", line 114, in <module>
    from tensorflow.python.platform import test
  File "/usr/lib/python2.7/site-packages/tensorflow/python/platform/test.py", line 60, in <module>
    import mock                # pylint: disable=g-import-not-at-top,unused-import
  File "/usr/lib/python2.7/site-packages/mock/__init__.py", line 2, in <module>
    import mock.mock as _mock
  File "/usr/lib/python2.7/site-packages/mock/mock.py", line 71, in <module>
    _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




以上是关于Exception: Versioning for this project requires either an sdist tarball,问题解决方法的主要内容,如果未能解决你的问题,请参考以下文章

php versioning4.php

php versioning3.php

php versioning2.php

php versioning.php

No module named migrate.versioning

semver(Semantic Versioning)