1
我正在使用Python的基本入門示例,但遇到了問題。喜歡它似乎無法找到KeenClient我安裝使用如下「PIP安裝熱衷」ImportError:沒有名爲KeenClient的模塊
代碼是如下
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)
和錯誤消息是:
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/wimw/Dropbox/Programming/Python/keen.py"]
[dir: /Users/wimw/Dropbox/Programming/Python]
[path: /usr/bin:/bin:/usr/sbin:/sbin]
我在Mac上運行,但在Ubuntu上也有這個問題。根據文檔,我安裝了「pip install keen」的Keen SDK。任何方式來解決這個問題?
感謝您的全面追溯;它有助於調試問題。通常需要對發生的事情進行一些猜測,但不是在這裏。 –