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>") 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...