在Azure自动化中安装Python 2软件包时出错 [英] Error installing Python 2 packages in Azure Automation

查看:61
本文介绍了在Azure自动化中安装Python 2软件包时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Azure自动化中安装

Runbook允许您指定要下载的程序包,例如,Azure(第四个参数)将下载所有Azure模块及其所有依赖项,大约为105.

Runbook完成后,您可以检查自动化帐户中共享资源"下的"Python 2软件包"页面,以验证是否正确导入了这些软件包.

希望有帮助.

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?

解决方案

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.

这篇关于在Azure自动化中安装Python 2软件包时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆