简体   繁体   English

为什么我收到内部服务器错误

[英]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

  • under the Apache server user 在Apache服务器用户下
  • system-wide using pip 全系统使用pip

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 为什么我会收到 500 内部服务器错误消息? - Why am I getting the 500 Internal Server Error message? BeautifulSoup:为什么会出现内部服务器错误? - BeautifulSoup: Why am i getting an internal server error? 为什么在使用MySQLdb连接时,烧瓶中出现500个内部服务器错误? - Why am I Getting 500 internal server error in flask while connecting using MySQLdb? "为什么在使用 Heroku 部署 Django 时出现内部服务器错误(管理页面仍然有效)?" - Why am I getting an internal server error when deploying Django with Heroku (admin page still works)? 为什么在导入本地 python 文件时出现 500 内部服务器错误? - Why am I getting a 500 Internal Server Error when importing local python file? 为什么通过python请求调用rest api时出现500 Internal Server Error? - Why am I getting 500 Internal Server Error when calling post rest api via python request? 我收到“内部检查系统错误” - i am getting “internal check system error” 对Yelp API进行身份验证时,我在本地Python服务器上收到内部服务器错误 - I am getting an internal server error on my local Python server when authenticating to Yelp API 为什么我在尝试使用 Python Flask 时收到“内部服务器错误”? - Why am I receiving 'Internal Server Error' - when attempting to use Python Flask? 在生产服务器上部署期间,我在 django 应用程序中收到 500 内部服务器错误 ModuleNotFoundError: No module named 'main' (wsgi:error) - I am getting 500 Internal Server Error in django app during deloying on production server ModuleNotFoundError: No module named 'main' (wsgi:error)
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM