无法在Python中导入merkletools库

时间:2018-10-30 12:12:34

标签: python python-3.x apache cgi

我将成功执行的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/

1 个答案:

答案 0 :(得分:0)

请参考此链接- 1. https://github.com/Tierion/pymerkletools 2. https://github.com/tierion/merkle-tools

还要检查您的python版本及其依赖项。