我一直在尝试使用模型识别图像中的内容的功能。 我已经将此运行在本地正常了。 不幸的是,当我发布它时,它不起作用。
我遇到以下问题:
Exception: ImportError: libgthread-2.0.so.0: cannot open shared object file: No such file or directory
Stack: File "/usr/local/lib/python3.6/site-packages/azure_functions_worker/dispatcher.py", line 240, in _handle__function_load_request
func_request.metadata.entry_point)
File "/usr/local/lib/python3.6/site-packages/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 "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 941, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "<frozen importlib._bootstrap>", line 994, in _gcd_import
File "<frozen importlib._bootstrap>", line 971, in _find_and_load
File "<frozen importlib._bootstrap>", line 955, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 665, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 678, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/home/site/wwwroot/MyHttpTrigger/__init__.py", line 3, in <module>
import cv2
File "/usr/local/lib/python3.6/site-packages/cv2/__init__.py", line 3, in <module>
from .cv2 import *
我尝试使用docker上传的方法和内置的上传方法,两者都给出相同的问题。
有人见过这个问题以及您如何解决它。
Docker和Python对我来说都是新手,所以请解释一下。
答案 0 :(得分:0)
似乎在抱怨找不到cv2库。我建议使用当前选择加入的新的远程构建功能。这比使用docker方法要容易得多。如果从CLI发布,则为:
func azure functionapp publish <function-name> --build remote
应上载requirements.txt文件,并直接在功能环境中构建和解决依赖关系。