Python|3.8.3调用阿里云slb的SDK报错两则


域名证书到期,用的阿里云七层SLB,证书也放在了SLB上,乖乖,三十多个SLB要统一更新一下证书,人工操作,容易出错不错,也比较耗时.决定使用阿里云的Python SDK
类似

from aliyunsdkcore.client import AcsClient
from aliyunsdkcore.request import CommonRequest
client = AcsClient('<accessKeyId>', '<accessSecret>', 'cn-hangzhou')
...
...
response = client.do_action_with_exception(request)
# python2:  print(response) 
print(str(response, encoding = 'utf-8'))

拿到示例代码后,直接运行,报错

ModuleNotFoundError: No module named 'aliyunsdkcore'

解决

aliyun-python-sdk-core-v3

再次运行,提示

ModuleNotFoundError: No module named 'aliyunsdkslb'

解决

aliyun-python-sdk-slb

再次运行
提示''和''未设置,这个简单阿里云 后台取一下就可以了
然后就可以愉快的玩耍了.


相关博文

About rainbird

IOS攻城狮
This entry was posted in Python and tagged , , , , , , , , , . Bookmark the permalink.

发表评论