I use Python 3.5 and I have installed cloudant package by an execute command:
sudo -H pip3 install cloudant
I try to connect with python database. According to the documentation - https://console.bluemix.net/docs/services/Cloudant/getting-started.html#getting-started-with-cloudant. This code should works:
from cloudant.client import Cloudant
client = Cloudant("username", "password", url="https://user_name.cloudant.com")
client.connect()
client.disconnect()
When I run it I get an error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/tomek/Projects/stage-control/cloudant.py", line 1, in <module>
from cloudant.client import Cloudant
ImportError: No module named 'cloudant.client'; 'cloudant' is not a package
Just rename your file
cloudant.py
to something else.