Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

165
Views
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
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!