# Instalar paquetes de Python

La **Import Package Window** te permite añadir dependencias de Python al mismo entorno que ejecuta:

* Designer Window custom blocks (`custom_blocks/*.py`)
* otros scripts de usuario que se ejecutan dentro de AugeLab Studio

## Primer vistazo <a href="#first-look" id="first-look"></a>

<figure><img src="/files/rHjzCslV0sBP2Rg8vfYa" alt="Import Package Window"><figcaption><p>Import Package Window</p></figcaption></figure>

## Abrir la ventana <a href="#open-window" id="open-window"></a>

* Menú: `Tools > Import Package Window`

## Hoja de referencia rápida <a href="#quick-cheat-sheet" id="quick-cheat-sheet"></a>

| Quieres…                                             | Usar                                                  | Notas                                                                      |
| ---------------------------------------------------- | ----------------------------------------------------- | -------------------------------------------------------------------------- |
| Copiar un único archivo `.py` a Studio               | `IMPORT SCRIPT TO STUDIO`                             | Útil para pequeños helpers (p. ej., `utils.py`).                           |
| Copiar una carpeta local completa (paquete) a Studio | `IMPORT PACKAGE TO STUDIO`                            | Elige una carpeta que contenga módulos Python.                             |
| Instalar desde PyPI                                  | `INSTALL PACKAGE FROM PYPI` + `ADD PACKAGE TO STUDIO` | Requiere Internet. Puedes introducir varios nombres (separados por comas). |
| Validar información de nombre/versión del paquete    | `CHECK PACKAGE INFO`                                  | Imprime metadatos en el panel de logs.                                     |
| Abrir la ayuda integrada                             | `Help` (menú superior en la ventana)                  | Abre “Import Python Package Manual”.                                       |

{% hint style="warning" %}
Instalar paquetes de terceros puede reducir la portabilidad. Si tu escenario necesita ejecutarse en otra máquina, instala los mismos paquetes allí también (misma versión de Python + plataforma).
{% endhint %}

<details>

<summary>Install from PyPI</summary>

1. Abre `Tools > Import Package Window`.
2. En **INSTALL PACKAGE FROM PYPI**, escribe uno o más nombres de paquetes (separados por comas).
3. Haz clic en **CHECK PACKAGE INFO** para confirmar que el paquete existe y revisar los metadatos.
4. Haz clic en **ADD PACKAGE TO STUDIO** y observa el log para ver el progreso/errores.

{% hint style="info" %}
Los paquetes se instalan en el directorio “pkgs” de Studio (el mismo entorno usado por los custom blocks de Designer).
{% endhint %}

</details>

<details>

<summary>Import a local script (.py)</summary>

1. Haz clic en **IMPORT SCRIPT TO STUDIO**.
2. Elige un archivo `.py`.
3. Confirma el mensaje de éxito.

Usa esto cuando quieras importar un módulo helper y luego hacer `import my_helper` desde tu custom block.

</details>

<details>

<summary>Import a local package (folder)</summary>

1. Haz clic en **IMPORT PACKAGE TO STUDIO**.
2. Elige una carpeta que contenga tu paquete/módulos Python.
3. Confirma el mensaje de éxito (o lee el diálogo de error).

{% hint style="info" %}
Si actualizas el paquete más tarde, vuelve a importarlo (o elimina la copia vieja primero y luego importa de nuevo).
{% endhint %}

</details>

<details>

<summary>Troubleshooting</summary>

| Problema                                | Qué intentar                                                                                  |
| --------------------------------------- | --------------------------------------------------------------------------------------------- |
| “Package not found”                     | Verifica el nombre en `pypi.org` y vuelve a intentar con **CHECK PACKAGE INFO**.              |
| La instalación falla a mitad de proceso | Comprueba tu conexión a Internet y revisa la salida del log.                                  |
| Un custom block falla al importar       | Envuelve las importaciones opcionales en `try/except ImportError` y maneja `None` en `run()`. |

</details>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.augelab.com/spanish/caracteristicas-clave/instal-custom-packages-with-package-window.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
