【发布时间】:2018-10-30 12:12:33
【问题描述】:
我将成功执行的 merkletools 操作保存在普通 python 脚本中。但是在处理 CGI 脚本时,我无法使用 from merkletools import MerkleTools 导入 merkletools 库。有什么解决办法吗?
我正在使用 apache2 服务器。 apache2错误日志如下
[Tue Oct 30 17:16:13.309058 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] AH01215: Traceback (most recent call last):: /var/www/cgi-bin/file.py, referer: http://192.168.2.91/
[Tue Oct 30 17:16:13.309199 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] AH01215: File "/var/www/cgi-bin/file.py", line 2, in <module>: /var/www/cgi-bin/file.py, referer: http://192.168.2.91/
[Tue Oct 30 17:16:13.309254 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] AH01215: : /var/www/cgi-bin/file.py, referer: http://192.168.2.91/
[Tue Oct 30 17:16:13.309299 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] AH01215: from merkletools import MerkleTools: /var/www/cgi-bin/file.py, referer: http://192.168.2.91/
[Tue Oct 30 17:16:13.309345 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] AH01215: ImportError: /var/www/cgi-bin/file.py, referer: http://192.168.2.91/
[Tue Oct 30 17:16:13.309386 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] AH01215: : : /var/www/cgi-bin/file.py, referer: http://192.168.2.91/
[Tue Oct 30 17:16:13.309428 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] AH01215: No module named merkletools: /var/www/cgi-bin/file.py, referer: http://192.168.2.91/
[Tue Oct 30 17:16:13.309449 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] AH01215: : /var/www/cgi-bin/file.py, referer: http://192.168.2.91/
[Tue Oct 30 17:16:13.311719 2018] [cgi:error] [pid 23964:tid 139710529734400] [client 192.168.2.91:51042] End of script output before headers: file.py, referer: http://192.168.2.91/
【问题讨论】:
标签: python python-3.x apache cgi