I am currently trying to install the package google-api-python-client in my Azure Function (Python) I add the packages to the requirements.txt file and deploy the application to azure. But as soon as I execute the import from googleapiclient.discovery import build in my Python file there is an internal error when I trigger the function. Without the import the function returns a valid response.
Has anyone ever had that problem?
The only thing I can figure from azure log is:
Failure Exception: ContextualVersionConflict: (protobuf 3.11.3 (/azure-functions-host/workers/python/3.7/LINUX/X64), Requirement.parse('protobuf>=3.12.0'), {'google-api-core'}) Stack: File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/dispatcher.py", line 259, in _handle__function_load_request func_request.metadata.entry_point) File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/utils/wrappers.py", line 29, in call return func(*args, **kwargs) File "/azure-functions-host/workers/python/3.7/LINUX/X64/azure_functions_worker/loader.py", line 73, in load_function mod = importlib.import_module(fullmodname) File "/usr/local/lib/python3.7/importlib/init.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 953, in _find_and_load_unlocked File "", line 219, in _call_with_frames_removed File "", line 1006, in _gcd_import File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 728, in exec_module File "", line 219, in _call_with_frames_removed File "/home/site/wwwroot/HttpHeartrate/init.py", line 8, in from googleapiclient.discovery import build File "/home/site/wwwroot/.python_packages/lib/site-packages/googleapiclient/discovery.py", line 49, in import google.api_core.client_options File "/home/site/wwwroot/.python_packages/lib/site-packages/google/api_core/init.py", line 23, in version = get_distribution("google-api-core").version File "/azure-functions-host/workers/python/3.7/LINUX/X64/pkg_resources/init.py", line 482, in get_distribution dist = get_provider(dist) File "/azure-functions-host/workers/python/3.7/LINUX/X64/pkg_resources/init.py", line 358, in get_provider return working_set.find(moduleOrReq) or require(str(moduleOrReq))[0] File "/azure-functions-host/workers/python/3.7/LINUX/X64/pkg_resources/init.py", line 901, in require needed = self.resolve(parse_requirements(requirements)) File "/azure-functions-host/workers/python/3.7/LINUX/X64/pkg_resources/init.py", line 792, in resolve raise VersionConflict(dist, req).with_context(dependent_req)
