Search code examples
pythonpython-2.7tensorflowtextsum

Tensorflow textsum error of Versioning


I am trying to convert the training text file to bin file for training the textsum of tensorflow. But I encountered the following error:

$ python textsum/data_convert_example.py --command text_to_binary --in_file data/tt.txt --out_file data/bin_data_train
Traceback (most recent call last):
  File "textsum/data_convert_example.py", line 12, in <module>
    import tensorflow as tf
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/__init__.py", line 24, in <module>
    from tensorflow.python import *
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/__init__.py", line 104, in <module>
    from tensorflow.python.platform import test
  File "/usr/local/lib/python2.7/dist-packages/tensorflow/python/platform/test.py", line 57, in <module>
    import mock                # pylint: disable=g-import-not-at-top,unused-import
  File "/usr/local/lib/python2.7/dist-packages/mock/__init__.py", line 2, in <module>
    import mock.mock as _mock
  File "/usr/local/lib/python2.7/dist-packages/mock/mock.py", line 71, in <module>
    _v = VersionInfo('mock').semantic_version()
  File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 461, in semantic_version
    self._semantic = self._get_version_from_pkg_resources()
  File "/usr/local/lib/python2.7/dist-packages/pbr/version.py", line 448, in _get_version_from_pkg_resources
    result_string = packaging.get_version(self.package)
  File "/usr/local/lib/python2.7/dist-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 possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.

Kindly help me. I am using tensorflow 1.2.0 with python 2.7.2.


Solution

  • You must have a problem with your install.

    Please try the following commands:

    pip install --upgrade mock pip install --upgrade distribute

    If it does not work, you should give us more details about how you installed tensorflow (pip? conda? clone & setup.py?) and try to reinstall from scratch.

    Hope it helps