0

我正在尝试创建我的第一个 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

有任何想法吗?

4

2 回答 2

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/访问 requirements.txt,这是 404ing。

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

> pip install -r $PEBBLE_HOME/requirements.txt # Where $PEBBLE_HOME is where you put the SDK
于 2014-05-22T11:46:42.550 回答
0

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

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

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

于 2014-01-26T00:12:23.893 回答