首页 > 解决方案 > 在 azure 中创建 webjob 时出现 python 包安装错误

问题描述

我正在创建一个 webjob,它具有以下 python 依赖项(azure-storage-blob==12.8.1,azure)以及其他依赖项,问题在于我的代码仅在 3-4 小时后就卡在了下面。

Dowenloading azure_common-1.1.8-py2.py3-none-any.whl(7.9kb)
pip is looking at multiple versions of azure-core to determine which version is compatible 
with other requirements. This could take a while.
[08/12/2021 19:55:54 > d827c9: INFO] INFO: This is taking longer than usual. You might need to 
provide the dependency resolver with stricter constraints to reduce runtime. If you want to  
abort this run, you can press Ctrl + C to do so. To improve how pip performs, tell us what 
happened here: https://pip.pypa.io/surveys/backtracking

问题是,如果我安装了特定版本的 azure,那么它与 azure-storage-blob 不兼容,并且在导入 blob 存储时抛出错误,如果 f 没有安装 azure 或其他与 azure-storage-blob 不兼容的 azure 版本==12.8.1 并抛出以下错误:

 from azure.keyvault import KeyVaultAuthentication, KeyVaultClient
 ImportError: cannot import name 'KeyVaultAuthentication'

有谁知道如何在创建 azure webjob 时安装 python 包以及解决此问题的解决方案

我还有另一个与触发的 webjob 相关的问题,所以假设如果我成功安装了软件包,那么每次运行它是否会安装所有软件包,或者它只会在第一次点击并保存在 env 中的软件包时

标签: azureazure-blob-storageazure-webjobsazure-keyvaultazure-python-sdk

解决方案


通过运行检查依赖树在本地的样子pip freeze,然后提供严格的版本以防止依赖解析超时。


推荐阅读