La generación de la canalización falla debido a un error no disponible de Python

Corrija el error de generación de la canalización debido a un error de Python creando un proyecto de Maven que utilice el complemento exec para instalar Python3.

Descripción description

Entorno

AEM as a Cloud Service

Problema/Síntomas

La versión 3.10 de Python debe instalarse, ya que el código de front-end requiere que Python genere la aplicación.

Sin embargo, al implementar la canalización en Cloud Manager, la compilación falla con el siguiente error:

[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! configure error
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack     at PythonFinder.fail (/build_root/build/<project>/ui.frontend/node_modules/node-gyp/lib/find-python.js:330:47)
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/build_root/build/<project>/ui.frontend/node_modules/node-gyp/lib/find-python.js:159:21)
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/build_root/build/<project>/ui.frontend/node_modules/node-gyp/lib/find-python.js:266:16)
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/build_root/build/<project>/ui.frontend/node_modules/node-gyp/lib/find-python.js:297:7)
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:317:7)
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:365:28)
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! System Linux 5.10.102.2-microsoft-standard
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! command "/build_root/build/<project>/ui.frontend/node/node" "/build_root/build/<project>/ui.frontend/node_modules/node-gyp/bin/node-gyp.js" "rebuild" "--verbose" "--libsass_ext=" "--libsass_cflags=" "--libsass_ldflags=" "--libsass_library="
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! cwd /build_root/build/<project>/ui.frontend/node_modules/node-sass
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! node -v v16.0.0
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! node-gyp -v v8.4.1
[ Exec Stream Pumper]  [ INFO]  npm ERR! gyp ERR! not ok
[ Exec Stream Pumper]  [ INFO]  npm ERR! Build failed with error code: 1
[ Exec Stream Pumper]  [ INFO]
[ Exec Stream Pumper]  [ INFO]  npm ERR! A complete log of this run can be found in:
[ Exec Stream Pumper]  [ INFO]  npm ERR!     /root/.npm/_logs/2023-11-06T17_43_49_109Z-debug.log

Haga Preguntas En Nuestra Comunidad De Experience League Campaign

Si tiene alguna pregunta que le gustaría que se respondiera sobre este tema, o leer las preguntas respondidas anteriores, le invitamos a ver nuestra Publicación de blog de Experience League Community que incluye este artículo, envíenos sus preguntas y comentarios y únase a nuestra comunidad de Experience League Campaign.

Resolución resolution

Si Python no está instalado, Maven se puede instalar siguiendo estos pasos.

Hasta Crear un proyecto Maven que utiliza el complemento exec para instalar Python3, se debe realizar una configuración en un pom.xml.

Por ejemplo:

<project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"><modelVersion>4.0.0</modelVersion><groupId>com.example</groupId><artifactId>PythonInstaller</artifactId><version>1.0-SNAPSHOT</version><packaging>jar</packaging>
<build><plugins><plugin><groupId>org.codehaus.mojo</groupId><artifactId>exec-maven-plugin</artifactId><version>1.6.0</version><executions><execution><id>apt-get-update</id><phase>validate</phase><goals><goal>exec</goal></goals><configuration><executable>apt-get</executable><arguments><argument>update</argument></arguments></configuration></execution><execution><id>install-python3</id><phase>validate</phase><goals><goal>exec</goal></goals><configuration><executable>apt-get</executable><arguments><argument>install</argument><argument>-y</argument><argument>python3</argument></arguments></configuration></execution></executions></plugin></plugins></build></project>

La configuración de Maven ejecutará el apt-get actualizar y apt-get install -y python3 durante la fase de validación del ciclo vital de generación de Maven. Tenga en cuenta también que esto solo funcionará si la generación se ejecuta en un entorno en el que la variable apt-get El comando está disponible y en ejecución. La compilación debe tener permisos suficientes para instalar paquetes.

Del mismo modo, si necesita instalar Python 3.11, el pom.xml debería tener un aspecto similar al siguiente:

**``` <project xmlns="http://maven.apache.org/POM/4.0.0"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> 4.0.0 com.example PythonInstaller 1.0-SNAPSHOT jar

<build><plugins><plugin><groupId>org.codehaus.mojo</groupId><artifactId>exec-maven-plugin</artifactId><version>1.6.0</version><executions><execution><id>apt-get-update</id><phase>validate</phase><goals><goal>exec</goal></goals><configuration><executable>apt-get</executable><arguments><argument>update</argument></arguments></configuration></execution><execution><id>install-python3.11</id><phase>validate</phase><goals><goal>exec</goal></goals><configuration><executable>apt-get</executable><arguments><argument>install</argument><argument>-y</argument><argument>python3.11</argument></arguments></configuration></execution></executions></plugin></plugins></build></project>
```**

+-----------------------------------+
| Target Insertion                  |
+--------------------------+--------+
| recommendation-more-help |        |
+--------------------------+--------+

---

+--------------------------------------+
| Toc                                  |
+--------------------------------------+
| 3d58f420-19b5-47a0-a122-5c9dab55ec7f |
+--------------------------------------+

---

+-------------+
| Doc Actions |
+-------------+
|             |
+-------------+

+----------+
| Mini Toc |
+----------+
|          |
+----------+

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Metadata                                                                                                                                                                  |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| id                       | 654d1f3ebef8e626228572df                                                                                                                       |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| coveo-solution           | Experience Manager                                                                                                                             |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| applies-to               | Experience Manager                                                                                                                             |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| article-created-by       | Zita Rodricks                                                                                                                                  |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| article-created-date     | 5/30/2024 3:10:56 PM                                                                                                                           |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| article-number           | KA-23141                                                                                                                                       |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| article-published-by     | Zita Rodricks                                                                                                                                  |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| article-published-date   | 5/30/2024 3:12:22 PM                                                                                                                           |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| breadcrumb-url           | /docs/experience-cloud-kcs/kbarticles/KA-08979.html                                                                                            |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| bug                      | False                                                                                                                                          |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| cloud                    | Experience Cloud, Document Cloud                                                                                                               |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| coveo-content-type       | Troubleshooting                                                                                                                                |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| description              | "Aprenda a corregir un error de generación de canalización debido a un error de Python".                                                       |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| dynamics-url             | https\://adobe-ent.crm.dynamics.com/main.aspx?forceUCI=1\&pagetype=entityrecord\&etn=knowledgearticle\&id=be661acc-961e-ef11-840a-000d3a372703 |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| git-commit               | 2815413385fc52c4c042fe8db294bde7055d6722                                                                                                       |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| git-commit-file          |                                                                                                                                                |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| git-edit                 | https\://github.com/AdobeDocs/experience-cloud-kcs.es-ES/tree/master/articles/KA-23141.md                                                      |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| git-filename             | /articles/KA-23141.md                                                                                                                          |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| git-issue                | https\://github.com/AdobeDocs/experience-cloud-kcs.es-ES/issues/new                                                                            |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| git-repo                 | https\://github.com/AdobeDocs/experience-cloud-kcs.es-ES                                                                                       |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| ht-degree                | 3%                                                                                                                                             |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| index                    | true                                                                                                                                           |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| internal-notes           | None                                                                                                                                           |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| keywords                 | KCS,Error De Python,Complemento De Maven                                                                                                       |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| landing-page-description | "Aprenda a corregir un error de generación de canalización debido a un error de Python".                                                       |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| last-update              | Thu May 30 2024 00:00:00 GMT\+0000 (Coordinated Universal Time)                                                                                |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| next-page                | /docs/experience-cloud-kcs/kbarticles/KA-16763.html?lang=es                                                                                    |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| original-solution        | Experience Manager                                                                                                                             |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| pipeline\_filename       | /articles/KA-23141.md                                                                                                                          |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| pipeline\_internal       | false                                                                                                                                          |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| prev-page                | /docs/experience-cloud-kcs/kbarticles/KA-21682.html?lang=es                                                                                    |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| product                  | Experience Manager                                                                                                                             |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| publish-url              | https\://experienceleague.adobe.com/docs/experience-cloud-kcs/kbarticles/KA-23141.html?lang=es                                                 |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| resolution               | Resolution                                                                                                                                     |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| showfeedback             | true                                                                                                                                           |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| solution                 | Experience Manager                                                                                                                             |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| solution-title           | Troubleshooting                                                                                                                                |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| source-git-commit        | 9475fbc2a06c5d526ac6aad6444305a97fa49767                                                                                                       |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| source-wordcount         | 260                                                                                                                                            |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| title                    | La generación de la canalización falla debido a un error no disponible de Python \| Adobe Experience Manager                                   |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| type                     | Troubleshooting                                                                                                                                |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| version-number           | 5                                                                                                                                              |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| workflow-type            | tm\+mt                                                                                                                                         |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| build-date               | Tue Jun 11 2024 14:55:51 GMT\+0000 (Coordinated Universal Time)                                                                                |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+
| breadcrumbs              | \[{"title":"Documentación","url":"/docs/"},{"title":"La generación de la canalización falla debido a un error no disponible de                 |
|                          | Python","url":""}]                                                                                                                             |
+--------------------------+------------------------------------------------------------------------------------------------------------------------------------------------+