Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

166
Vistas
Ejecute un script de python en un servidor Apache con importaciones múltiples

Entonces, soy bastante nuevo en todo esto. Intento configurar un botón en el sitio web que luego ejecuta un archivo python presionando. He terminado con la instalación de apache2, wordpress y la configuración de CGI. Puedo editar mi lado con wordpress y puedo iniciar un pequeño programa de python ('first.py')

 #!/usr/bin/python3 import cgitb #from influxdb import InfluxDBClient #import yaml cgitb.enable() print("Content-Type: text/html;charset=utf-8") print ("Content-type:text/html\r\n") print("<H1> Hello, From python server :) </H1>")
El resultado es:
 curl http://localhost/cgi-bin/first.py <H1> Hello, From python server :) </H1>

con el CGI... así que todo listo y configurado. PERO ...

Si trato de importar mis lib como yaml o Influx, siempre aparece el mismo mensaje de error

 <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN"> <html><head> <title>500 Internal Server Error</title> </head><body> <h1>Internal Server Error</h1> <p>The server encountered an internal error or misconfiguration and was unable to complete your request.</p> <p>Please contact the server administrator at webmaster@localhost to inform them of the time this error occurred, and the actions you performed just before this error.</p> <p>More information about this error may be available in the server error log.</p> <hr> <address>Apache/2.4.38 (Raspbian) Server at localhost Port 80</address> </body></html>

Y sí... Porque instalé esos módulos... Tengo varios archivos que usan estos import continuamente sin ningún problema.

Entonces... creo que los módulos no están instalados en apache o no se pudieron encontrar. ¿Alguien tiene una idea de cómo importar los módulos correctamente... es casi inútil si no puedo usar python sin las importaciones necesarias!

alguien me puede ayudar... este es mi examen final...

over 4 years ago · Santiago Trujillo
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda