我在连接Apache,Python和mysql数据库后进行测试。
当我在代码中插入import pandas as pd
时出现错误。
浏览器窗口中出现的错误屏幕如下。
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator at admin@example.com to inform them of the time this error occurred, and the actions you performed just before this error.
More information about this error may be available in the server error log.
我查看了上述屏幕,并检查了Apache错误日志。 错误日志文件中发生的错误如下。
End of script output before headers: index.py
AH01215: Traceback (most recent call last):\r: C:/Apache24/htdocs/VideoSearchProgram/index.py
AH01215: File "C:/Apache24/htdocs/VideoSearchProgram/index.py", line 7, in <module>\r: C:/Apache24/htdocs/VideoSearchProgram/index.py
AH01215: import pandas as pd\r: C:/Apache24/htdocs/VideoSearchProgram/index.py
AH01215: File "C:\\Program Files (x86)\\Microsoft Visual Studio\\Shared\\Python37_86\\lib\\site-packages\\pandas\\__init__.py", line 17, in <module>\r: C:/Apache24/htdocs/VideoSearchProgram/index.py
AH01215: "Unable to import required dependencies:\\n" + "\\n".join(missing_dependencies)\r: C:/Apache24/htdocs/VideoSearchProgram/index.py
AH01215: ImportError: Unable to import required dependencies:\r: C:/Apache24/htdocs/VideoSearchProgram/index.py
AH01215: pytz: No module named 'pytz'\r: C:/Apache24/htdocs/VideoSearchProgram/index.py
Pandas已正常安装,开发工具为Visual Studio。
#!python
import pymysql as pm
import pandas
print("content-type: text/html; charset=utf-8\n")
print("hello world\n")
代码如上所述,文件名为'index.py'。
请帮助我。谢谢。