Database Reference
In-Depth Information
setuptools
Under the hood these commands rely on the Python s etuptools
( https://pypi.python.org/pypi/setuptools ) package. This
package simplifies Python package management and is used again later
in this chapter to install the client libraries. You should install this
package in your system Python library so that it is easily accessible. You
may also want to consider pip ( https://pypi.python.org/pypi/
pip ) , which is an alternative that has some advantages but is not
available for all operating systems.
Now you can run a command as your service account by specifying the new
.bigqueryrc file:
$ bq --bigqueryrc=$HOME/
.bigqueryrc.$SERVICE_ACCOUNT_ID ls
If you get an error complaining that service accounts require the Python
OpenSSL library ( https://pypi.python.org/pypi/pyOpenSSL ) ,
then you need to install that module before proceeding. The easiest way to
do that is to use the setuptools Python package distribution framework.
With this package manager installed you just need to execute:
$ easy_install pyOpenSSl
This fetches and sets up the necessary packages. If you are unable to install
packages in a system-wide Python library location, you will need to modify
this command to install the library in a private location that is included in
the PYTHONPATH environment variable. After this is complete you can try
rerunning the client command.
The ls command you just ran generates the same output you would get
when running the command under your own Google account. If you try to
list jobs, however, you can see that there are no jobs run by the service
account yet.
Search WWH ::




Custom Search