我已经按照 Google官方教程通过 SSH 在 Pepper 机器人上安装了 Google Speech API 。
为了测试它,我创建了一个文件speechTest.py
,在其中导入 API,如下所示:
from google.cloud import speech
这是有效的!到目前为止,一切都很好。但是当我想在 Choregraphe 的 Python 框中做同样的事情时,问题就出现了;当我收到错误消息时:
[ERROR] behavior.box :createPythonModule:0
_Behavior__lastUploadedChoregrapheBehaviorbehavior_11325017632:/GoogleSTT_7:
User class evaluation failed with the error:
<class 'pkg_resources.DistributionNotFound'>
google-cloud-speech
我尝试了社区提出的解决方案,但没有成功。sys.path
当我在 Choregraphe 框中从 Python打印时,我得到:
[WARN ] behavior.box :onLoad:15 _Behavior__lastUploadedChoregrapheBehaviorbehavior_1811402208:/GoogleSTT_7:
/usr/lib/python2.7/site-packages
/usr/lib
/home/nao/.local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg
/usr/lib/python27.zip
/usr/lib/python2.7
/usr/lib/python2.7/plat-linux2
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/home/nao/.local/lib/python2.7/site-packages
/usr/lib/python2.7/site-packages/PIL
/usr/lib/python2.7/site-packages/gst-0.10
/usr/lib/python2.7/site-packages/gtk-2.0
/usr/share/dialog/
/home/nao/.local/share/PackageManager/apps/dialog_lexicon/./
/home/nao/.local/share/PackageManager/apps/dialog_adjust_volume/dlg_adjust_volume/
/home/nao/.local/share/PackageManager/apps/dialog_adjust_volume/my_apps_topic/
/home/nao/.local/share/PackageManager/apps/dialog_applauncher/dlg_applauncher/
/home/nao/.local/share/PackageManager/apps/dialog_applauncher/dlg_suggest_app/
/home/nao/.local/share/PackageManager/apps/dialog_battery_capacity/dlg_battery_capacity/
/home/nao/.local/share/PackageManager/apps/dialog_battery_level/dlg_battery_level/
/home/nao/.local/share/PackageManager/apps/dialog_bleep_sounds/dlg_bleep_sounds/
/home/nao/.local/share/PackageManager/apps/dialog_can_you_repeat/dlg_can_you_repeat/
/home/nao/.local/share/PackageManager/apps/dialog_clock/dlg_clock/
/home/nao/.local/share/PackageManager/apps/dialog_engines/dlg_engines/
/home/nao/.local/share/PackageManager/apps/dialog_goodbye/dlg_goodbye/
/home/nao/.local/share/PackageManager/apps/dialog_hello/dlg_hello/
/home/nao/.local/share/PackageManager/apps/dialog_help/dlg_help/
/home/nao/.local/share/PackageManager/apps/dialog_how_are_you/dlg_how_are_you/
/home/nao/.local/share/PackageManager/apps/dialog_impossible_moves/dlg_impossible_moves/
/home/nao/.local/share/PackageManager/apps/dialog_internet_connection/dlg_internet_connection/
/home/nao/.local/share/PackageManager/apps/dialog_lexicon/skin_B2B/
/home/nao/.local/share/PackageManager/apps/dialog_lexicon/skin_tmp_tweak/
/home/nao/.local/share/PackageManager/apps/dialog_manage_events/dlg_manage_events/
/home/nao/.local/share/PackageManager/apps/dialog_move_arms/dlg_move_arms/
/home/nao/.local/share/PackageManager/apps/dialog_move_hands/dlg_move_hands/
/home/nao/.local/share/PackageManager/apps/dialog_move_head/dlg_move_head/
/home/nao/.local/share/PackageManager/apps/dialog_posture/dlg_posture_pepper/
/home/nao/.local/share/PackageManager/apps/dialog_posture/dlg_posture_nao/
/home/nao/.local/share/PackageManager/apps/dialog_reflex_engaged/dlg_reflex_engaged/
/home/nao/.local/share/PackageManager/apps/dialog_robot_characteristics/dlg_character/
/home/nao/.local/share/PackageManager/apps/dialog_robot_characteristics/dlg_personal_info/
/home/nao/.local/share/PackageManager/apps/dialog_robot_characteristics/dlg_humanoid/
/home/nao/.local/share/PackageManager/apps/dialog_robot_characteristics/dlg_interaction/
/home/nao/.local/share/PackageManager/apps/dialog_robot_origins/dlg_robot_origins/
/home/nao/.local/share/PackageManager/apps/dialog_robot_relationships/dlg_robot_relationships/
/home/nao/.local/share/PackageManager/apps/dialog_robots/dlg_robots/
/home/nao/.local/share/PackageManager/apps/dialog_robots/dlg_asimov/
/home/nao/.local/share/PackageManager/apps/dialog_robots/dlg_famous_robots/
/home/nao/.local/share/PackageManager/apps/dialog_say_something_else/dlg_say_something_else/
/home/nao/.local/share/PackageManager/apps/dialog_set_offset/dlg_set_offset/
/home/nao/.local/share/PackageManager/apps/dialog_shutdown/dlg_shutdown/
/home/nao/.local/share/PackageManager/apps/dialog_stop_talking/dlg_stop_talking/
/home/nao/.local/share/PackageManager/apps/dialog_store/dlg_ade/
/home/nao/.local/share/PackageManager/apps/dialog_switch_language/dlg_switch_language/
/home/nao/.local/share/PackageManager/apps/dialog_thank_you/dlg_thank_you/
/home/nao/.local/share/PackageManager/apps/dialog_touch/dlg_touch_head/
/home/nao/.local/share/PackageManager/apps/dialog_what_can_you_do/dlg_what_can_you_do/
/home/nao/.local/share/PackageManager/apps//dialog_reflex/reflex/
/home/nao/.local/lib/python2.7/site-packages/google/cloud/
这表明它应该找到谷歌包。我怎么解决这个问题?我不知道如何将 Google Speech API 导入 Choregraphe 项目。
编辑:当我sys.path
在机器人上的本地 Python 文件中输出时,我得到了这个:
/var/persistent/home/nao
/home/nao/.local/lib/python2.7/site-packages/pip-9.0.1-py2.7.egg
/usr/lib/python27.zip
/usr/lib/python2.7
/usr/lib/python2.7/plat-linux2
/usr/lib/python2.7/lib-tk
/usr/lib/python2.7/lib-old
/usr/lib/python2.7/lib-dynload
/home/nao/.local/lib/python2.7/site-packages
/usr/lib/python2.7/site-packages
/usr/lib/python2.7/site-packages/PIL
/usr/lib/python2.7/site-packages/gst-0.10
/usr/lib/python2.7/site-packages/gtk-2.0