Learn more about migrating to the Google Ads API by watching our latest webinar

Installation

Whether you're installing the library from PyPi or cloning it from GitHub, It's recommended that you conduct the below steps using an active virtual environment. For information on how to create and activate a virtual environment, see the Virtual Environment documentation.

Installing the module from PyPi

The library is distributed on PyPI and can be installed easily using pip. Just run the following command:

python -m pip install google-ads

Installing the library from GitHub

The source code for the library can be cloned from GitHub onto your local machine. It's useful to clone the source code in order to easily execute the examples, or to develop the library itself. For reference, running one of the authentication examples is a required step in configuring the library for use.

  1. Ensure that python3.6 or greater is present in your environment. The simplest way is to use pyenv:

    pyenv global 3.6
    
  2. Clone the client library from GitHub:

    git clone git@github.com:googleads/google-ads-python.git
    
  3. Enter the repository and install it:

    cd google-ads-python
    python -m pip install .
    

If you intend to develop the library, you will want to run the unit tests before and after making any changes:

  1. Ensure you have both python3.6 and python3.7 available in your environment. Using pyenv, as mentioned above:

    pyenv global 3.6 3.7
    
  2. Run the unit tests to ensure the library is functioning properly:

    nox