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

pkg_resources fails to find gcloud on the first run of an env #2182

Closed
dhermes opened this issue Aug 24, 2016 · 4 comments
Closed

pkg_resources fails to find gcloud on the first run of an env #2182

dhermes opened this issue Aug 24, 2016 · 4 comments
Assignees
Labels
packaging priority: p2 Moderately-important priority. Fix may not be included in next release.

Comments

@dhermes
Copy link
Contributor

dhermes commented Aug 24, 2016

@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
@theacodes
Copy link
Contributor

theacodes commented 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?

@lukesneeringer lukesneeringer added the priority: p2 Moderately-important priority. Fix may not be included in next release. label Apr 19, 2017
@duggelz
Copy link

duggelz commented 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
Copy link
Contributor

theacodes commented Jun 21, 2017

pkg_resources works 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
Copy link

duggelz commented Jun 21, 2017

You're right, I'm thinking of pkgutil, which I have a couple of open bugs for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
packaging priority: p2 Moderately-important priority. Fix may not be included in next release.
Projects
None yet
Development

No branches or pull requests

4 participants