У меня проблема с импортом ocrmypdf lib на скрипт Python, выполняемый в функции Azure.
Приложение функции работает на linux и B1 appserviceplan в регионе WestEurope.
import sys
import os
sys.path.append(os.path.abspath(os.path.join(os.path.dirname( __file__ ), 'a/Lib/site-packages')))
import logging
from invoice2data import extract_data
import json
import img2pdf
from ocrmypdf import leptonica
import ocrmypdf
import azure.functions as func
from azure.cosmosdb.table.tableservice import TableService
from azure.cosmosdb.table.models import Entity
Я ожидаю, чтоИмпортировать lib без ошибок, но на самом деле это заканчивается следующей ошибкой:
Result: Failure
Exception: error: symbol 'setMsgSeverity' not found in library '<None>': python: undefined symbol: setMsgSeverity
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/BlobTrigger/__init__.py", line 9, in <module>
from ocrmypdf import leptonica
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/ocrmypdf/__init__.py", line 18, in <module>
from . import helpers, hocrtransform, leptonica, pdfa, pdfinfo
File "/home/site/wwwroot/.python_packages/lib/python3.6/site-packages/ocrmypdf/leptonica.py", line 43, in <module>
lept.setMsgSeverity(lept.L_SEVERITY_WARNING)
Любые предложения будут оценены:)