Skip to content

"Project was not passed" error, even though ran  #1792

@BrandonY

Description

@BrandonY

I attempted to follow the setup instructions and ran into an odd error. The instructions I was following are here: https://googlecloudplatform.github.io/gcloud-python/stable/gcloud-auth.html

Here is what I attempted:

  1. virtualenv ~/venv
  2. source ~/venv/bin/activate
  3. pip install gcloud
  4. gcloud auth login
  5. python
>>> from gcloud import pubsub
>>> pubsub.Client()

Here's the error I received when I ran pubsub.Client()

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File ".../venv/local/lib/python2.7/site-packages/gcloud/client.py", line 184, in __init__
    _ClientProjectMixin.__init__(self, project=project)
  File ".../venv/local/lib/python2.7/site-packages/gcloud/client.py", line 143, in __init__
    raise EnvironmentError('Project was not passed and could not be '
EnvironmentError: Project was not passed and could not be determined from the environment.

I do appear to have valid credentials. gcloud.credentials.get_credentials() happily provides me with a perfectly good GoogleCredentials object which works fine with httplib2 if I invoke it directly.

Metadata

Metadata

Assignees

Labels

api: bigqueryIssues related to the BigQuery API.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions