ImportError:无法导入msrest.authentication

时间:2016-06-21 17:04:36

标签: python azure

我的Python 2.7.9包含azure-2.0.0rc4和msrest-0.4.0。我的代码无法从msrest.authentication导入。我检查了azure和msrest包中的两个文件,但没有发现任何问题。

欣赏任何建议和指示。

约翰

Traceback (most recent call last):
  File "getCredential.py", line 1, in <module>
    from azure.common.credentials import ServicePrincipalCredentials
  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

2 个答案:

答案 0 :(得分:2)

这似乎是pip install --pre azure的错误。

之后运行此命令将安装必要的软件包:

pip install msrestazure

答案 1 :(得分:0)

我发现了这个问题。当我sudo pip install时,没有为其他组设置读取权限。一旦我解决了这个问题,问题就消失了。

相关问题