Wenn Sie sich mit anderen Nutzern über unsere Produkte austauschen und Feedback geben möchten, können Sie dem offiziellen Google Ads-Discord-Kanal auf dem Server der
Google Advertising and Measurement Community beitreten.
Installation
Mit Sammlungen den Überblick behalten
Sie können Inhalte basierend auf Ihren Einstellungen speichern und kategorisieren.
Unabhängig davon, ob Sie die Bibliothek von PyPI installieren oder von GitHub klonen, empfehlen wir, die folgenden Schritte in einer aktiven virtuellen Umgebung auszuführen. Informationen zum Erstellen und Aktivieren einer virtuellen Umgebung finden Sie in der Dokumentation Virtuelle Umgebung.
Modul aus PyPI installieren
Die Bibliothek wird auf PyPI bereitgestellt und kann mit pip mit dem folgenden Befehl installiert werden:
python -m pip install google-ads
Bibliothek von GitHub installieren
Der Quellcode für die Bibliothek kann von GitHub auf Ihren lokalen Computer geklont werden. Es ist sinnvoll, den Quellcode zu klonen, um die Beispiele einfach auszuführen oder die Bibliothek selbst zu entwickeln. Zur Erinnerung: Das Ausführen eines der Authentifizierungsbeispiele ist ein erforderlicher Schritt bei der Konfiguration der Bibliothek.
Prüfen Sie, ob python3.8
oder höher in Ihrer Umgebung vorhanden ist.
Am einfachsten ist es, pyenv
zu verwenden:
pyenv local 3.8
Klonen Sie die Clientbibliothek aus GitHub:
git clone git@github.com:googleads/google-ads-python.git
Rufen Sie das Repository auf und installieren Sie es:
cd google-ads-python
python -m pip install .
Wenn Sie die Bibliothek entwickeln möchten, führen Sie die Unittests vor und nach jeder Änderung aus:
Prüfen Sie, ob alle unterstützten Versionen der Python-Sprache in Ihrer Umgebung verfügbar sind. pyenv
verwenden::
pyenv local 3.8 3.9 3.10 3.11 3.12
Installieren Sie die testspezifischen Abhängigkeiten der Bibliothek:
python -m pip install .[tests]
Führen Sie die Komponententests aus, um sicherzustellen, dass die Bibliothek ordnungsgemäß funktioniert:
nox
Optional: Die Einheitentests können auch mit Docker ausgeführt werden. Zuerst müssen Sie Docker installieren. Führen Sie dann im Verzeichnis google-ads-python
Folgendes aus:
docker build -t google-ads-python:test .
docker run -it google-ads-python:test nox
Sofern nicht anders angegeben, sind die Inhalte dieser Seite unter der Creative Commons Attribution 4.0 License und Codebeispiele unter der Apache 2.0 License lizenziert. Weitere Informationen finden Sie in den Websiterichtlinien von Google Developers. Java ist eine eingetragene Marke von Oracle und/oder seinen Partnern.
Zuletzt aktualisiert: 2025-08-27 (UTC).
[null,null,["Zuletzt aktualisiert: 2025-08-27 (UTC)."],[[["\u003cp\u003eThe Google Ads Python library can be installed from PyPI using pip with the command \u003ccode\u003epython -m pip install google-ads\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eTo install from GitHub, clone the repository, navigate into it, and run \u003ccode\u003epython -m pip install .\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eEnsure you have Python 3.8 or later installed in your environment, potentially using pyenv.\u003c/p\u003e\n"],["\u003cp\u003eDevelopers should run unit tests before and after making changes, utilizing nox or Docker for execution.\u003c/p\u003e\n"],["\u003cp\u003eFor library setup and usage, refer to the Virtual Environment and authentication example documentation.\u003c/p\u003e\n"]]],[],null,["# Installation\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\nWhether you're installing the library from PyPI or cloning it from GitHub, we\nrecommended that you conduct the below steps using an active virtual\nenvironment. For information on how to create and activate a virtual\nenvironment, see the [Virtual Environment](//docs.python.org/3/tutorial/venv.html) documentation.\n\nInstall the module from PyPI\n----------------------------\n\nThe library is distributed on [PyPI](//pypi.org/project/google-ads/) and can\nbe installed using [pip](//pip.pypa.io/en/stable/installing) with the\nfollowing command: \n\n python -m pip install google-ads\n\nInstall the library from GitHub\n-------------------------------\n\nThe source code for the library can be cloned from [GitHub](https://github.com/googleads/google-ads-python/)\nonto your local machine. It's useful to clone the source code in order to easily\nexecute the examples or to develop the library itself. For reference, running\none of the authentication examples is a required step in configuring the library\nfor use.\n\n1. Ensure that `python3.8` or later is present in your environment.\n The simplest way is to use [`pyenv`](//github.com/pyenv/pyenv-installer):\n\n pyenv local 3.8\n\n2. Clone the client library from GitHub:\n\n git clone git@github.com:googleads/google-ads-python.git\n\n3. Enter the repository and install it:\n\n cd google-ads-python\n python -m pip install .\n\n4. If you intend to develop the library, run the unit tests before and after\n making any changes:\n\n 1. Ensure you have all supported versions of the Python language available in\n your environment. Using `pyenv`::\n\n pyenv local 3.8 3.9 3.10 3.11 3.12\n\n 2. Install the test-specific dependencies of the library:\n\n python -m pip install .[tests]\n\n 3. Run the unit tests to ensure the library is functioning properly:\n\n nox\n\n 4. Optional: the unit tests can also be run using Docker. First, you must\n have [Docker installed](https://docs.docker.com/get-docker/). Then, from\n the `google-ads-python` directory, run the following:\n\n docker build -t google-ads-python:test .\n docker run -it google-ads-python:test nox"]]