> For the complete documentation index, see [llms.txt](https://docs.unitlab.ai/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.unitlab.ai/api-sdk-cli/hi/get-started/install-the-python-sdk-and-cli.md).

# Python SDK और CLI इंस्टॉल करें

Unitlab Python SDK और unitlab CLI इंस्टॉल करें: pip, pipx, uv या Poetry से इंस्टॉलेशन, वर्शन पिन करना, शेल कम्प्लीशन, प्रॉक्सी और सुरक्षित अपग्रेड।

एक ही पैकेज, `unitlab`, Python SDK और `unitlab` कमांड दोनों इंस्टॉल करता है। इसके लिए **Python 3.10 या नया** चाहिए और यह macOS, Linux और Windows पर चलता है।

## इंस्टॉल करें <a href="#install" id="install"></a>

{% stepper %}
{% step %}

### वर्चुअल एनवायरनमेंट बनाएँ <a href="#create-a-virtual-environment" id="create-a-virtual-environment"></a>

```bash
python3 -m venv .venv
source .venv/bin/activate
```

Windows पर इसकी जगह `.venv/Scripts/activate` चलाएँ।
{% endstep %}

{% step %}

### पैकेज इंस्टॉल करें <a href="#install-the-package" id="install-the-package"></a>

```bash
python -m pip install --upgrade unitlab
```

प्रोडक्शन जॉब के लिए वर्शन पिन करें, ताकि कोई नई रिलीज़ अचानक व्यवहार न बदल दे:

```bash
python -m pip install "unitlab==3.2.0"
```

{% endstep %}

{% step %}

### इंस्टॉलेशन जाँचें <a href="#check-the-installation" id="check-the-installation"></a>

```bash
unitlab --version
```

यह कमांड इंस्टॉल किया गया वर्शन दिखाती है, जैसे `3.2.0`। Python में `unitlab.__version__` में यही मान होता है। अगर दोनों अलग हैं, तो आपका शेल किसी दूसरे एनवायरनमेंट की `unitlab` कमांड चला रहा है। सही एनवायरनमेंट एक्टिवेट करके फिर से कोशिश करें।
{% endstep %}
{% endstepper %}

इसके बाद, [API key बनाएँ और क्लाइंट कॉन्फ़िगर करें](https://docs.unitlab.ai/api-sdk-cli/hi/get-started/authentication-and-api-keys.md)।

## इंस्टॉल करने के दूसरे तरीके <a href="#other-ways-to-install" id="other-ways-to-install"></a>

| टूल                                | कमांड                                        |
| ---------------------------------- | -------------------------------------------- |
| pipx (सिर्फ़ CLI, अलग एनवायरनमेंट) | `pipx install unitlab`                       |
| uv                                 | `uv pip install unitlab` या `uv add unitlab` |
| Poetry                             | `poetry add unitlab`                         |
| requirements.txt                   | `unitlab==3.2.0`                             |

## डिपेंडेंसी <a href="#dependencies" id="dependencies"></a>

यह पैकेज `httpx`, `tqdm` और `typer` पर निर्भर है। इसमें कोई कम्पाइल्ड एक्सटेंशन नहीं है, इसलिए यह बिल्ड टूल के बिना स्लिम कंटेनर और CI इमेज में भी इंस्टॉल हो जाता है।

## शेल कम्प्लीशन <a href="#shell-completion" id="shell-completion"></a>

कमांड और विकल्पों के लिए टैब कम्प्लीशन चालू करें:

```bash
unitlab --install-completion
```

इसके बाद शेल को रीस्टार्ट करें। अगर आप स्क्रिप्ट खुद जोड़ना चाहते हैं, तो `unitlab --show-completion` उसे प्रिंट कर देता है।

## प्रॉक्सी और TLS <a href="#proxies-and-tls" id="proxies-and-tls"></a>

SDK `httpx` का इस्तेमाल करता है, जो मानक प्रॉक्सी वेरिएबल `HTTPS_PROXY`, `HTTP_PROXY`, `ALL_PROXY` और `NO_PROXY` पढ़ता है। SOCKS प्रॉक्सी सपोर्टेड हैं। TLS सर्टिफ़िकेट हमेशा वेरिफ़ाई किए जाते हैं।

## सुरक्षित तरीके से अपग्रेड करें <a href="#upgrade-safely" id="upgrade-safely"></a>

1. अपने वर्शन और नवीनतम वर्शन के बीच के वर्शनों का [चेंजलॉग](https://docs.unitlab.ai/api-sdk-cli/hi/get-started/versioning-and-changelog.md) पढ़ें।
2. पहले उसी इंस्टॉल कमांड से किसी टेस्ट एनवायरनमेंट को अपग्रेड करें।
3. प्रोडक्शन जॉब बदलने से पहले एक छोटा अपलोड और एक रिलीज़ डाउनलोड चलाकर देखें।

## संबंधित पेज <a href="#related" id="related"></a>

[ऑथेंटिकेशन और API keys](https://docs.unitlab.ai/api-sdk-cli/hi/get-started/authentication-and-api-keys.md) · [Python SDK क्विकस्टार्ट](https://docs.unitlab.ai/api-sdk-cli/hi/get-started/python-sdk-quickstart.md) · [CLI क्विकस्टार्ट](https://docs.unitlab.ai/api-sdk-cli/hi/get-started/cli-quickstart.md)
