我的 python 脚本在我的计算机上本地设置的 Apache 服务器上运行得很好,但是,在导入 json2html 库时,我收到了内部服务器错误
我将 import 语句注释掉的那一刻,它似乎起作用了。我什至尝试只从库中导入函数,认为这可能是空间限制左右。
#!/usr/bin/python
import cgi,cgitb
#import json2html#this has the errir
import cassandra
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
内部服务器错误
来自日志:ImportError: No module named json2html [Tue Jun 11 15:42:52.495135 2019] [cgid:error] [pid 2235:tid 140698967865088] [client 127.0.0.1:35474 before show script output] End of show script.pys] , 引用:http ://test.com/ Traceback(最近一次调用最后一次):文件“/home/arjun/Cassandra/website_test/show.py”,第 6 行,从 json2html 导入 *
该模块在我的系统上运行良好,没有出现任何错误,但在服务器上运行时似乎有问题。
有人可以帮忙解决这个问题吗?
服务器可能在不同的用户下运行。在这种情况下,您可能安装json2html
在 Apache 服务器用户无法访问的位置。
要检查这一点,请运行一个sys.version
在本地和服务器中打印的小脚本。如果不匹配,请尝试安装json2html
:
pip
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句