You will need to be able to run Python.
Python is available for Linux, Mac OS X and Windows.
I recommend pip and virtualenv.
Pip is the recommend tool for installing Python packages.
The Google Cloud API Libraries are available as pip packages.
A Virtual Environment (aka "virtualenv") is a "tool to keep dependencies required by different projects in separate places".
Create a directory for your project and then:
cd my_project_folder
virtualenv venv
You may name your virtualenv folder other than "venv" but this name is a useful reminder of the directory's purpose. virtualenv should display something similar to:
New python executable in venv/bin/python
Installing setuptools, pip, wheel...done.
The virtualenv is created but, to use it, we must activate
it. When we're done using it, it's a good practice (although not mandatory) to deactivate
it too.
source venv/bin/activate
To indicate that we're in the virtualenv called venv, the command-prompt on my Linux machine changes. You will remain in your project directory. Your mileage may vary, but:
(venv) user@host
Now let's upgrade pip and install the Google API Client Libraries
pip install --upgrade pip
pip install --upgrade google-api-python-client
All being well if you type pip freeze
, you should see something similar to this list. Your versions may be higher:
pip freeze
google-api-python-client==1.6.2
httplib2==0.10.3
oauth2client==4.0.0
pyasn1==0.2.3
pyasn1-modules==0.0.8
rsa==3.4.2
six==1.10.0
uritemplate==3.0.0
Your Python environment is now ready, the Google API Client Libraries are installed. We can write our Python code. Please continue to the next example.
When you're finished with the project, it's a good practice to deactivate
the virtualenv. Please don't do this now as we're going to write some code. But, when you're done, please return here and:
deactivate
If you wish to return to the virtualenv, just re-run the activate
command