So, I'm pretty new to this whole thing. I try to set up a button on the website which then executes a python file by pressing. I'm done with the installation of apache2, wordpress and the CGI-setup. I'm able to edit my side with wordpress and I'm able to start a small python program ('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>
with the CGI... so everything done and set up. BUT...
If i try to import my lib's like yaml or Influx then there always occur the same Errormessage
<!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>
And yes... Ofcause i installed those modules... I have several files which uses these import continously with no problem at all.
So... i think the modules are not installed on apache or they could not be found. Has anyone an idea how to import the modules correctly... it is nearly useless if i cant use python without the neccessary imports!
can anybody please help... this is my final exam...