[英]Why am I getting an Internal Server error
My python script runs just fine on the Apache server locally set up on my computer, however, on importing the json2html library I am getting an internal server error 我的python脚本在我的计算机上本地设置的Apache服务器上运行得很好,但是,在导入json2html库时我收到内部服务器错误
The moment I comment the import statement out , it seems to work. 在我评论import语句的那一刻,它似乎有效。 I even tried importing just the functions from the library , thinking maybe it is a space constraint or so.
我甚至尝试从库中导入函数,认为它可能是一个空间约束。
#!/usr/bin/python
import cgi,cgitb
#import json2html#this has the errir
import cassandra
from cassandra.cluster import Cluster
from cassandra.auth import PlainTextAuthProvider
Internal Server Error 内部服务器错误
From logs: 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] End of script output before headers: show.py, referer: http://test.com/ Traceback (most recent call last): File "/home/arjun/Cassandra/website_test/show.py", line 6, in from json2html import * 来自日志:ImportError:没有名为json2html的模块[Tue Jun 11 15:42:52.495135 2019] [cgid:error] [pid 2235:tid 140698967865088] [client 127.0.0.1:35474]标题前的脚本输出结束:show.py ,referer: http ://test.com/ Traceback(最近一次调用最后一次):文件“/home/arjun/Cassandra/website_test/show.py”,第6行,来自json2html import *
The module works fine on my system and dosen't give any errors,but it seems to have a problem when running on the server. 该模块在我的系统上工作正常并且不会出现任何错误,但在服务器上运行时似乎有问题。
Can somebody help fix this? 有人可以帮忙解决这个问题吗?
The server may be running under a different user. 服务器可能在不同的用户下运行。 In that case, you may have installed
json2html
in a location that the Apache server user cannot access. 在这种情况下,您可能已在Apache服务器用户无法访问的位置安装了
json2html
。
To check this, run a small script that prints sys.version
both locally and in the server. 要检查这一点,请运行一个小脚本,在本地和服务器中打印
sys.version
。 If there is a mismatch, then try installing json2html
either: 如果不匹配,请尝试安装
json2html
:
pip
pip
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.