[英]Azure Functions Python Status: 500 Internal Server Error
Exception: ModuleNotFoundError: No module named 'pandas'
Stack: File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/dispatcher.py", line 242, in _handle__function_load_request
func_request.metadata.entry_point)
File "/azure-functions-host/workers/python/3.6/LINUX/X64/azure_functions_worker/loader.py", line 66, in load_function
mod = importlib.import_module(fullmodname)
File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/home/site/wwwroot/HttpExample/__init__.py", line 9, in <module>
import pandas as pd
I get this error on Azure Functions when run online.在线运行时,我在 Azure 函数上收到此错误。 There is a requirements.txt file which contains the pandas requirement but it still manages to not find the module name pandas.
有一个 requirements.txt 文件,其中包含 pandas 要求,但它仍然设法找不到模块名称 pandas。 Locally the function works fine.
在本地 function 工作正常。
According to the conversation in comments, I'm not sure what the problem is.根据评论中的对话,我不确定问题是什么。 But I post all of the steps I did just now for your reference, I follow the steps below and it didn't show the error message about import pandas.
但是我发布了我刚才所做的所有步骤供您参考,我按照以下步骤操作,它没有显示有关导入 pandas 的错误消息。
pip install pandas
Then add the code "import pandas as pd" and call the pad in the main code.然后在主代码中添加代码“import pandas as pd”并调用pad。
pip freeze > requirements.txt
After run this command, my "requirements.txt" show as below:运行此命令后,我的“requirements.txt”显示如下:
func azure functionapp publish hurypyfun --build remote
Hope it would be helpful to your problem~希望对你的问题有所帮助~
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.