使用Python笔记本中的标准步骤连接到Cloudant文档时出现问题
如果我尝试使用下面的代码示例连接到cloudant笔记本,则我能够成功连接。
from cloudant.client import Cloudant
from cloudant.error import CloudantException
from cloudant.result import Result, ResultByKey
serviceUsername = "abc"
servicePassword = "abc"
serviceURL = "https://abc.bluemix.cloudantnosqldb.appdomain.cloud"
client = Cloudant(serviceUsername, servicePassword, url=serviceURL)
client.connect()
databaseName = "condenser_heat_rate_rejection_kw"
gmDBDemo = client.create_database(databaseName)
if gmDBDemo.exists():
print "'{0}' successfully created.\n".format(databaseName)
# Start the demo.
print "===\n"
当我导入时上述行集失败时 导入csv并编写一些代码示例,以将csv文件中的数据读取到笔记本单元格中
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-20-3e935b3d0a6d> in <module>()
----> 1 from cloudant.client import Cloudant
2 from cloudant.document import Document
3 from cloudant.error import CloudantException
4 from cloudant.result import Result, ResultByKey
5
ModuleNotFoundError: No module named 'cloudant'
不确定是什么问题,有人可以提出建议!