Function app "dot" not found in path when doing pydot

Wang, Zheng 65 Reputation points
2023-07-10T02:39:04.4266667+00:00

Hi,

By Function App (Python), I try to generate png file from dot content, and store the png file to blob.

In the requirements.txt, I have added graphviz and pydot

Following code works fine locally, but on Azure, I got the error information.

Can you help me to check it?

Result: Failure Exception: FileNotFoundError: [Errno 2] "dot" not found in path. Stack: File "/azure-functions-host/workers/python/3.10/LINUX/X64/azure_functions_worker/dispatcher.py", line 479, in _handle__invocation_request call_result = await self._loop.run_in_executor( File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run result = self.fn(*self.args, **self.kwargs) File "/azure-functions-host/workers/python/3.10/LINUX/X64/azure_functions_worker/dispatcher.py", line 752, in _run_sync_func return ExtensionManager.get_sync_invocation_wrapper(context, File "/azure-functions-host/workers/python/3.10/LINUX/X64/azure_functions_worker/extension.py", line 215, in _raw_invocation_wrapper result = function(**args) File "/home/site/wwwroot/TxtTriggerDiagram/init.py", line 125, in main dtimage_file = create_image_file(dtimage_name, dtdot_blobtext) File "/home/site/wwwroot/TxtTriggerDiagram/init.py", line 78, in create_image_file graph = graphs[0].create_png() File "/home/site/wwwroot/.python_packages/lib/site-packages/pydot.py", line 1733, in new_method return self.create( File "/home/site/wwwroot/.python_packages/lib/site-packages/pydot.py", line 1933, in create raise OSError(*args)

    import pydot

	blob = BlobClient.from_connection_string(connect_str, output_container, imagename)
    graphs = pydot.graph_from_dot_data(dotstring)
    graph = graphs[0].create_png()
    blob.upload_blob(graph, blob_type="BlockBlob")
Azure Functions
Azure Functions
An Azure service that provides an event-driven serverless compute platform.
5,397 questions
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,063 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.