Repository navigation
pkg_resources fails to find gcloud on the first run of an env #2182
Copy link
Copy link
Closed
Labels
packagingpriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.
Description
@jonparrott I don't see this as a pressing issue, so if you don't know, just close it out.
Why does pkg_resources fail to find gcloud on the first run of an env? To complicate things, this doesn't happen when a new env. is created on Travis.
Here is an example
$ rm -fr .tox/docs
$ tox -e docs
GLOB sdist-make: .../gcloud-python/setup.py
docs create: .../gcloud-python/.tox/docs
docs installdeps: nose, nose-exclude, grpcio >= 1.0rc1, google-gax >= 0.12.3, < 0.13dev, gax-google-pubsub-v1 >= 0.8.0, < 0.9dev, grpc-google-pubsub-v1 >= 0.8.0, < 0.9dev, gax-google-logging-v2 >= 0.8.0, < 0.9dev, grpc-google-logging-v2 >= 0.8.0, < 0.9dev, nose, nose-exclude, grpcio >= 1.0rc1, google-gax >= 0.12.3, < 0.13dev, gax-google-pubsub-v1 >= 0.8.0, < 0.9dev, grpc-google-pubsub-v1 >= 0.8.0, < 0.9dev, gax-google-logging-v2 >= 0.8.0, < 0.9dev, grpc-google-logging-v2 >= 0.8.0, < 0.9dev, Sphinx, sphinx_rtd_theme
docs inst: .../gcloud-python/.tox/dist/gcloud-0.18.0.zip
docs installed: alabaster==0.7.9,Babel==2.3.4,docutils==0.12,enum34==1.1.6,future==0.15.2,futures==3.0.5,gax-google-logging-v2==0.8.1,gax-google-pubsub-v1==0.8.1,gcloud==0.18.0,google-gax==0.12.5,googleapis-common-protos==1.2.0,grpc-google-logging-v2==0.8.1,grpc-google-pubsub-v1==0.8.1,grpcio==1.0.0,httplib2==0.9.2,imagesize==0.7.1,Jinja2==2.8,MarkupSafe==0.23,nose==1.3.7,nose-exclude==0.4.1,oauth2client==3.0.0,ply==3.8,protobuf==3.0.0,pyasn1==0.1.9,pyasn1-modules==0.0.8,Pygments==2.1.3,pytz==2016.6.1,rsa==3.4.2,six==1.10.0,snowballstemmer==1.2.1,Sphinx==1.4.6,sphinx-rtd-theme==0.1.9
docs runtests: PYTHONHASHSEED='2428814037'
docs runtests: commands[0] | python -c import shutil; shutil.rmtree('docs/_build', ignore_errors=True)
docs runtests: commands[1] | sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html
Running Sphinx v1.4.6
making output directory...
Exception occurred:
File ".../gcloud-python/.tox/docs/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 853, in resolve
raise DistributionNotFound(req, requirers)
DistributionNotFound: The 'gcloud' distribution was not found and is required by the application
The full traceback has been saved in /tmp/sphinx-err-SrV6xS.log, if you want to report the issue to the developers.
Please also report this if it was a user error, so that a better error message can be provided next time.
A bug report can be filed in the tracker at <https://github.com/sphinx-doc/sphinx/issues>. Thanks!
ERROR: InvocationError: '.../gcloud-python/.tox/docs/bin/sphinx-build -W -b html -d docs/_build/doctrees docs docs/_build/html'
___________________________________________________________________ summary ___________________________________________________________________
ERROR: docs: commands failed
Metadata
Metadata
Assignees
Labels
packagingpriority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.
Activity
theacodes commentedon Aug 24, 2016
I actually don't know. ¯_(ツ)_/¯
My first guess was that gcloud wasn't installed, but it's installed on line 6.
You could try manually stepping into tox's virtualenv for the docs and seeing what's up?
duggelz commentedon Jun 21, 2017
Without looking at the code, a number of pieces of pkg_resources don't behave entirely correctly for namespace packages, and whether a package is a namespace package depends very delicately on sys.path, PYTHONPATH, .pth files, and most relevantly, any
__init__.pyc's that might only be generated after the first (or Nth) time something is imported.theacodes commentedon Jun 21, 2017
pkg_resourcesworks fine for ns packages and is in fact the mechanism by which we even have them. I'm not sure what this issue was, but it hasn't cropped up again since we switched to nox.duggelz commentedon Jun 21, 2017
You're right, I'm thinking of pkgutil, which I have a couple of open bugs for.
explicitly set timeout in steaming_annotate_video, and comment [(#2182)…
fix: ensure AccessEntry equality and repr uses the correct `entity_ty…
docs: Update AI operators deprecation notice (#2182)