Unable to import Python 3.8 package "plotly" into Azure Automation for use in Python runbooks
Hello,
I have an Azure automation account. Into this account, I would like to import a Python 3.8 package for plotly.
However, the import always fails. I tried it with several versions of the plotly package. Here are the results:
( 1 ) After importing plotly-5.18.0-py3-none-any.whl, downloaded from https://pypi.org/project/plotly/5.18.0/#files
Azure error message:
The Python package could not be imported. See below for details.
Last modified
26.10.2023, 15:17:26
Package version
Size
0 KB
Status
Failed
Runtime version
3.8
Error
Orchestrator.Activities.PythonPackageExtractException: Error while extractinig Python package: pip install failed for python package plotly. at Orchestrator.Activities.SetModuleActivity.ExecuteInternal(CodeActivityContext context, Byte[] moduleContent, String moduleName, ModuleLanguage moduleLanguage, Guid moduleVersionId, String modulePath) at Orchestrator.Activities.SetModuleActivity.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
( 2 ) After importing plotly-5.18.0.tar.gz, downloaded from the same link as above:
Azure error message:
The Python package could not be imported. See below for details.
Last modified
26.10.2023, 15:27:37
Package version
Size
0 KB
Status
Failed
Runtime version
3.8
Error
Orchestrator.Activities.PythonPackageExtractException: Error while extractinig Python package: pip could not convert tar.gz file C:\Users\Client\Temp\plotly.tar.gz to wheel file at Orchestrator.Activities.SetModuleActivity.ExecuteInternal(CodeActivityContext context, Byte[] moduleContent, String moduleName, ModuleLanguage moduleLanguage, Guid moduleVersionId, String modulePath) at Orchestrator.Activities.SetModuleActivity.Execute(CodeActivityContext context) at System.Activities.CodeActivity.InternalExecute(ActivityInstance instance, ActivityExecutor executor, BookmarkManager bookmarkManager) at System.Activities.Runtime.ActivityExecutor.ExecuteActivityWorkItem.ExecuteBody(ActivityExecutor executor, BookmarkManager bookmarkManager, Location resultLocation)
I also tried two whl files of older versions of plotly packages (the first versions of the years 2023 and 2022):
https://pypi.org/project/plotly/5.12.0/#files
https://pypi.org/project/plotly/5.6.0/#files
Unfortunately, Azure showed the same error message as above in (1)
There is a similar question here on Learn where it turned out that Azure engineers had to change something internally to make the import work: https://learn.microsoft.com/en-us/answers/questions/1253502/unable-to-import-python-package-(numpy)-in-azure-r
Due to another problem (kaleido package cannot be installed as Python 3.10 package), I cannot switch to Python 3.10 runbook as a workaround.
Can anyone help with this?
Best regards
Andreas