ImportError Client not found

20 views
Skip to first unread message

Wim Wauters

unread,
Mar 7, 2016, 1:37:04 PM3/7/16
to Keen IO Community
Hi,

I'm using the basic getting started example with Python, but am running into issues. Code is as below

from keen.client import KeenClient

# Initialize the Keen Client.
client = KeenClient("56ddb39a96773d7e98d63392", write_key="xxxx")

# Build your event properties as a dictionary.
ticket_purchase = {
  "price" : 50.00,
  "user": {
    "id": "020939382",
    "age": 28
  },
  "artist": {
    "id": "19039",
    "name": "Tycho"
  },
  "venue": {
    "id": "A93DJ",
    "name": "The Fillmore",
    "city": "San Francisco",
    "state": "California"
  }
}
# Add your event to the "ticket_purchases" collection.
client.add_event("ticket_purchases", ticket_purchase)

and error message is as follows:

Traceback (most recent call last):
  File "/Users/wim/Dropbox/Programming/Python/keen.py", line 1, in <module>
    import KeenClient
ImportError: No module named KeenClient
[Finished in 0.0s with exit code 1]
[shell_cmd: python -u "/Users/wauterw/Dropbox/Programming/Python/keen.py"]
[dir: /Users/wim/Dropbox/Programming/Python]
[path: /usr/bin:/bin:/usr/sbin:/sbin]

I'm running on MAC, but also have this issue on Ubuntu. I installed Keen SDK with "pip install keen" as per the documentation. Any way to solve this?

Thanks,

Wim

Taylor Barnett

unread,
Mar 8, 2016, 11:46:35 AM3/8/16
to Keen IO Community
Hey Wim! 

I'm having a bit of trouble replicating this error. I'm curious, what version of Python are you running? It will help me try to replicate the error. 

So far I have taken your code, put my own keys in, and successfully run your code. But I might be missing something in how you have it set up. 

Thanks!

-Taylor 
Reply all
Reply to author
Forward
0 new messages