nao机器人导入自己写的python程序,为NAO机器人安装Python SDK

I'm trying to follow the documentation provided by Aldebaran here in order to get my NAO ready for Python programming. I correctly dowloaded the NAOqi framework adapted to my OS (linux 64 bits) then I typed the command line $ export PYTHONPATH=${PYTHONPATH}:/path/to/python-sdk which, if I understand things right, should be typed in a terminal and not in a Python shell.

Then I typed import naoqi in a Python shell and got the ImportError: No module named naoqi error, so I tried troubleshooting and typed

import sys

print "\n".join(sys.path)

in the same Python sheel and got that :

/home/*****

/usr/bin

/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

/usr/local/lib/python2.7/dist-packages

/usr/lib/python2.7/dist-packages

/usr/lib/python2.7/dist-packages/PIL

/usr/lib/python2.7/dist-packages/gst-0.10

/usr/lib/python2.7/dist-packages/gtk-2.0

/usr/lib/python2.7/dist-packages/ubuntu-sso-client

/usr/lib/python2.7/dist-packages/ubuntuone-client

/usr/lib/python2.7/dist-packages/ubuntuone-control-panel

/usr/lib/python2.7/dist-packages/ubuntuone-couch

/usr/lib/python2.7/dist-packages/ubuntuone-installer

/usr/lib/python2.7/dist-packages/ubuntuone-storage-protocol

so I indeed don't have /path/to/python-sdk as I shoud but not I'm blocked. What should I do to solve that ?

I will add that I am new to Linux, Python and NAO so I'm sorry if the answer is actually obvious.

I have been trying to configurate my NAO for Python programming for almost 1 week so I really feel retarded. I need your help please.

解决方案

Suppose you have naoqi installed in /home/user/naoqi

1.- Open a text editor (Kate, Gedit,... whatever)

2.- Open the file /home/user/.profile

3.- At the end of the file, add the following line

export PYTHONPATH=${PYTHONPATH}:/home/user/naoqi

4.- Reboot (Close your session and login again also works, but just to be sure)

NOTE: Remember to change /home/user/naoqi with the correct path

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值