Azure Python SDK安装及排错

12 篇文章 0 订阅

安装流程请参考:
https://azure-sdk-for-python.readthedocs.io/en/latest/installation.html

Python版本:2.7.6

pip安装:

pip install --upgrade pip
pip install azure-batch 
pip install azure-mgmt-scheduler
pip install --pre azure-mgmt-compute
pip install --pre azure
pip install msrest
pip install msrestazure

Github源码安装:

git clone git://github.com/Azure/azure-sdk-for-python.git
cd azure-sdk-for-python
python setup.py install

【坑爹的错误】
1. msrest错误:

Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/site-packages/azure/common/credentials.py", line 25, in <module>
raise ImportError("You need to install 'msrest' to use this feature")
ImportError: You need to install 'msrest' to use this feature

排错步骤及思路:
这种错误表面azure在调用msrest时,msrest模块产生了错误,导致无法正确加在msrest模块。
在确保 msrest和msrestazure已经被安装的前提下,单独import msrest发现错误如下:

ImportError: No module named packages.urllib3

产生原因:requests版本过低。
解决方法:pip install --upgrade requests

2.ssl错误

AttributeError: 'X509' object has no attribute '_x509'

产生原因:pyopenssl版本过低
解决方法:pip install -U pyOpenSSL

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
您可以通过以下几种方式来安装PythonAzure SDK: 1. 参考文档:您可以参考Azure SDK for Python的官方文档,文档中提供了详细的安装流程和步骤。您可以点击这个链接以获取更多信息。 2. Github源码安装:您可以使用Git命令克隆Azure SDK for Python的Github源码,并按照以下步骤进行安装: - 打开终端或命令提示符并导航到您希望克隆源码的目录。 - 使用以下命令克隆源码:git clone git://github.com/Azure/azure-sdk-for-python.git - 进入克隆的目录:cd azure-sdk-for-python - 运行安装命令:python setup.py install 3. 使用pip安装:您可以使用pip命令来安装Azure SDK for Python的相关包。请按照以下步骤进行安装: - 更新pip:pip install --upgrade pip - 安装Azure Batch:pip install azure-batch - 安装Azure管理调度器:pip install azure-mgmt-scheduler - 安装预发布版本的Azure管理计算:pip install --pre azure-mgmt-compute - 安装预发布版本的Azure包:pip install --pre azure - 安装msrest:pip install msrest - 安装msrestazure:pip install msrestazure 请注意,在使用pip安装时,您可能需要使用管理员权限或虚拟环境来安装这些包。 希望这些信息对您有帮助,如果还有其他问题,请随时提问。谢谢!<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Azure Python SDK安装排错](https://blog.csdn.net/apache0554/article/details/54092537)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值