Python and Xively
Xively is a great service for all of your Internet of Things projects. When coupled with some simple Python code it can be turned into something quite powerful. However, I came across a really frustrating error that took a while to resolve and I only picked up a hint of the answer from a translation of a German IT blog.
The problem arises from attempting to open communication with the Xively API through, e.g.:
api = xively.XivelyAPIClient(API_KEY)
the resulting error message is:
AttributeError: 'module' object has no attribute 'XivelyAPIClient'
As far as I could tell my code was well formed and my calls to open communication through the API were the same as I had used in other code.
As it turns out the problem arises when you have any files named 'xively' in the current working directory. I had a couple of test programs in the same directory as my main code named 'xively.py' and 'xively.pyc'. Deleting both led to my code working first time.
This was the source of immense frustration and the loss of at least an hour today. Hopefully this post will give some help to others with the same problem and save them wasting so much time!














