इंस्टॉलेशन
संग्रह की मदद से व्यवस्थित रहें
अपनी प्राथमिकताओं के आधार पर, कॉन्टेंट को सेव करें और कैटगरी में बांटें.
PyPI से लाइब्रेरी इंस्टॉल करने या GitHub से उसे क्लोन करने के लिए, हमारा सुझाव है कि आप किसी चालू वर्चुअल एनवायरमेंट का इस्तेमाल करके, नीचे दिया गया तरीका अपनाएं. वर्चुअल एनवायरमेंट बनाने और चालू करने के तरीके के बारे में जानने के लिए, वर्चुअल एनवायरमेंट का दस्तावेज़ देखें.
PyPI से मॉड्यूल इंस्टॉल करना
लाइब्रेरी को PyPI पर उपलब्ध कराया जाता है. इसे pip का इस्तेमाल करके, इस कमांड के साथ इंस्टॉल किया जा सकता है:
python -m pip install google-ads
GitHub से लाइब्रेरी इंस्टॉल करना
लाइब्रेरी के सोर्स कोड को GitHub से अपनी लोकल मशीन पर क्लोन किया जा सकता है. उदाहरणों को आसानी से लागू करने या लाइब्रेरी को खुद डेवलप करने के लिए, सोर्स कोड को क्लोन करना मददगार होता है. उदाहरण के लिए, पुष्टि करने के किसी एक उदाहरण को चलाना, लाइब्रेरी को इस्तेमाल करने के लिए कॉन्फ़िगर करने का ज़रूरी चरण है.
पक्का करें कि आपके एनवायरमेंट में python3.8
या उसके बाद का वर्शन मौजूद हो.
pyenv
का इस्तेमाल करना सबसे आसान तरीका है:
pyenv local 3.8
GitHub से क्लाइंट लाइब्रेरी को क्लोन करें:
git clone git@github.com:googleads/google-ads-python.git
रिपॉज़िटरी डालें और उसे इंस्टॉल करें:
cd google-ads-python
python -m pip install .
अगर आपको लाइब्रेरी डेवलप करनी है, तो कोई भी बदलाव करने से पहले और बाद में यूनिट टेस्ट चलाएं:
पक्का करें कि आपके एनवायरमेंट में, Python भाषा के सभी वर्शन उपलब्ध हों. pyenv
का इस्तेमाल करके:
pyenv local 3.8 3.9 3.10 3.11 3.12
लाइब्रेरी की टेस्ट-स्पेसिफ़िक डिपेंडेंसी इंस्टॉल करें:
python -m pip install .[tests]
लाइब्रेरी सही तरीके से काम कर रही है, यह पक्का करने के लिए यूनिट टेस्ट चलाएं:
nox
ज़रूरी नहीं: यूनिट टेस्ट, Docker का इस्तेमाल करके भी चलाए जा सकते हैं. सबसे पहले, आपके पास Docker इंस्टॉल होना चाहिए. इसके बाद, google-ads-python
डायरेक्ट्री से यह कमांड चलाएं:
docker build -t google-ads-python:test .
docker run -it google-ads-python:test nox
जब तक कुछ अलग से न बताया जाए, तब तक इस पेज की सामग्री को Creative Commons Attribution 4.0 License के तहत और कोड के नमूनों को Apache 2.0 License के तहत लाइसेंस मिला है. ज़्यादा जानकारी के लिए, Google Developers साइट नीतियां देखें. Oracle और/या इससे जुड़ी हुई कंपनियों का, Java एक रजिस्टर किया हुआ ट्रेडमार्क है.
आखिरी बार 2025-08-27 (UTC) को अपडेट किया गया.
[null,null,["आखिरी बार 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"]]