我在用着:
- 库云 2.2.1
- 蟒蛇3.5.2
- 虚拟环境
- 带有 json 凭证文件的 GCE 服务帐户
Python 代码如下所示:
from libcloud.compute.types import Provider
from libcloud.compute.providers import get_driver
def run():
""" Run this script
"""
ComputeEngine = get_driver(Provider.GCE)
driver = ComputeEngine(user_id='****@****.com',
credential_file='serviceaccount.json',
project='****')
run()
当我运行我的代码时,我得到:
Traceback (most recent call last):
File "./myscript.py", line 47, in <module>
run()
File "./myscript.py", line 21, in run
project='ebs-it', secure=True)
File "/***/virtualenv/lib/python3.5/site-packages/libcloud/compute/drivers/gce.py", line 1795, in __init__
super(GCENodeDriver, self).__init__(user_id, key, **kwargs)
File "/***/virtualenv/lib/python3.5/site-packages/libcloud/common/base.py", line 975, in __init__
self.connection = self.connectionCls(*args, **conn_kwargs)
TypeError: __init__() missing 1 required positional argument: 'secure'
这对我来说看起来非常教科书。知道可能出了什么问题吗?