创建第一个Pebble项目时出错

时间:2014-01-25 14:50:06

标签: pebble-watch

我正在尝试创建我的第一个Pebble项目,当我运行pebble new_profile hello_world时它就会失败。

johndoe-mbp-2:projects johndoe$ pebble new-profile hello_world
[DEBUG   ] [Analytics] header: {'User-Agent': 'Pebble SDK/2.0-BETA6 (Darwin-13.0.0-x86_64-i386-64bit-python-2.7.5)'}, data: {'ck': '2.7.5', 'cn': 'Darwin-13.0.0-x86_64-i386-64bit', 'cid': '3247db56-af31-4738-999a-uuuuu', 'tid': 'UA-66666-7', 't': 'event', 'v': 1, 'cs': '3247db56-af31-4738-999a-yyyyy'}
category: install
action: import
label: fail: missing import: No module named websocket
value: 0
Traceback (most recent call last):
  File "/Users/johndoe/pebble-dev/PebbleSDK-2.0-BETA6/bin/../tools/pebble.py", line 14, in <module>
    import websocket        
ImportError: No module named websocket

有什么想法吗?

2 个答案:

答案 0 :(得分:0)

尝试卸载计算机上的任何websocket模块,然后重新安装Pebble SDK依赖项:

pip uninstall websocket
pip install --user -r ~/pebble-dev/PebbleSDK-2.0-BETA7/requirements.txt

注意:您需要在此命令行中更新SDK的位置。

答案 1 :(得分:0)

确保为 requirements.txt 文件提供绝对路径。我尝试从我安装Pebble SDK的目录中运行命令:

$PEBBLE_HOME> pip install requirements.txt

导致:

Downloading/unpacking requirements.txt
  Real name of requirement requirements.txt is requirements.txt
  Could not find any downloads that satisfy the requirement requirements.txt
Cleaning up...
No distributions at all found for requirements.txt
Storing debug log for failure in $HOME/.pip/pip.log

检查pip.log文件是否显示pip正在尝试访问来自https://pypi.python.org/simple/requirements.txt/的404.的<.p>中的requirements.txt。

一旦我改为使用绝对路径,这一切都很好:

> pip install -r $PEBBLE_HOME/requirements.txt # Where $PEBBLE_HOME is where you put the SDK