Error installing Python 2 packages in Azure Automation

霸气de小男生 提交于 2021-01-29 21:33:09

问题


I'm trying to install Instagram-API-python in Azure Automation to automatize data extraction from this API with a Python script.

When I try to install it uploading the .tar.gz file or by the "Import Python 2 packages from pypi" script, azure automation shows me the following message:

Orchestrator.Activities.PythonPackageExtractException: Error while extractinig Python package: Error converting tar.gz file to wheel file. Unexpected number of wheel files were created. 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)

Any idea why it is showing me this message?


回答1:


I am assuming that it is failing as it is not able to resolve all the dependencies , try using the Manual download option.

Azure automation doesn't resolve dependencies for python packages during the import process. There are two ways to import a package with all its dependencies. Only one of the following steps needs to be used to import the packages into your Automation Account.

Manual Download

On a Windows 64-bit machine with python2.7 and pip installed, run the following command to download a package and all its dependencies:

C:\Python27\Scripts\pip2.7.exe download -d <output dir> <package name>

Once the packages are downloaded, you can import them into your automation account.

RunBook

Import the python runbook Import Python 2 packages from pypi into Azure Automation account from the gallery into your Automation Account. Make sure the Run Settings are set to Azure and start the runbook with the parameters. The runbook requires a Run As Account for the Automation Account to work. For each parameter make sure you start it with the switch as seen in the following list and image:

  • s
  • g
  • a
  • m

The runbook allows you to specify what package to download, for example, Azure (the fourth parameter) will download all Azure modules and all its dependencies, which is about 105.

Once the runbook has completed you can check the Python 2 packages page under Shared Resources in your Automation Account to verify that they package was imported correctly.

Hope it helps.




回答2:


The Manual Download worked for me.



来源:https://stackoverflow.com/questions/56219327/error-installing-python-2-packages-in-azure-automation

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!