Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Testing in python - import tensorflow as tf throws error "Exception: Versioning for this project requires either an sdist tarball" #6411

Closed
mpooleery opened this issue Dec 20, 2016 · 1 comment

Comments

@mpooleery
Copy link

mpooleery commented Dec 20, 2016

NOTE: Only file GitHub issues for bugs and feature requests. All other topics will be closed.

What related GitHub issues or StackOverflow threads have you found by searching the web for your problem?

Some of the issues when searching for "import tensorflow as tf" gave answers related to either mock not being installed correctly or protobuf. In my case, all were installed correctly and successfully.

Environment info

Operating System:
Amazon Linux

Installed version of CUDA and cuDNN:
(please attach the output of ls -l /path/to/cuda/lib/libcud*):
I installed a CPU only version. So no CUDA

If installed from binary pip package, provide:

  1. A link to the pip package you installed:
  2. The output from python -c "import tensorflow; print(tensorflow.__version__)".

If possible, provide a minimal reproducible example (We usually don't have time to read hundreds of lines of your code)

the installation completed successfully. Here is the output:

sudo -H /usr/local/bin/pip install tensorflow
Requirement already satisfied: tensorflow in /usr/local/lib64/python2.7/site-packages
Requirement already satisfied: numpy>=1.11.0 in /usr/local/lib64/python2.7/site-packages (from tensorflow)
Requirement already satisfied: mock>=2.0.0 in /usr/local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: six>=1.10.0 in /usr/local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: protobuf==3.1.0 in /usr/local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: wheel in /usr/local/lib/python2.7/site-packages (from tensorflow)
Requirement already satisfied: funcsigs>=1; python_version < "3.3" in /usr/local/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow)
Requirement already satisfied: pbr>=0.11 in /usr/local/lib/python2.7/site-packages (from mock>=2.0.0->tensorflow)
Requirement already satisfied: setuptools in /usr/local/lib/python2.7/site-packages/setuptools-28.3.0-py2.7.egg (from protobuf==3.1.0->tensorflow)

What other attempted solutions have you tried?

Installed each of the dependencies individually. Still same issue.

Logs or other output that would be helpful


python -c "import tensorflow; print(tensorflow.version)"
Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python2.7/site-packages/tensorflow/init.py", line 24, in
from tensorflow.python import *
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/init.py", line 106, in
from tensorflow.python.platform import test
File "/usr/local/lib/python2.7/site-packages/tensorflow/python/platform/test.py", line 81, in
import mock # pylint: disable=g-import-not-at-top,unused-import
File "/usr/local/lib/python2.7/site-packages/mock/init.py", line 2, in
import mock.mock as _mock
File "/usr/local/lib/python2.7/site-packages/mock/mock.py", line 71, in
_v = VersionInfo('mock').semantic_version()
File "/usr/local/lib/python2.7/site-packages/pbr/version.py", line 460, in semantic_version
self._semantic = self._get_version_from_pkg_resources()
File "/usr/local/lib/python2.7/site-packages/pbr/version.py", line 447, in _get_version_from_pkg_resources
result_string = packaging.get_version(self.package)
File "/usr/local/lib/python2.7/site-packages/pbr/packaging.py", line 725, in get_version
raise Exception("Versioning for this project requires either an sdist"
Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. Are you sure that git is installed?

@mpooleery
Copy link
Author

Ok, this was resolved. The only thing I had to do was to upgrade the distribute module - "pip install --upgrade distribute".

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant