You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Nao机器人切换root失败,无法安装paho-mqtt求助

在Nao机器人上安装paho-mqtt遇到的权限问题及求助

我正尝试连接Nao机器人以安装MQTT客户端/监听器,目标是通过pip install paho-mqtt安装paho-mqtt,但需要管理员(root)权限。使用su切换root用户时收到错误提示Authentication failure,错误码为1。

已尝试的操作

  • 以nao用户执行pip install paho-mqtt,因文件系统只读导致安装失败;
  • 以nao用户执行sudo pip install paho-mqtt,收到错误:Sorry, user nao is not allowed to execute '/usr/bin/pip install paho-mqtt' as root on nao.;
  • 尝试pip install paho-mqtt --user,安装成功但包被安装到/.local/目录,无法激活并正常监听消息;
  • 尝试pip install paho-mqtt --root /usr/lib/python2.7/site-packages,nao用户无该目录写入权限,安装失败;
  • 分别测试机器人通过以太网连接和未连接以太网的情况;
  • 尝试通过raw(以太网连接时)和telnet连接,均被阻止。

其他情况

  • 机器人与笔记本电脑处于同一网络;
  • root密码仍为默认密码;
  • 试过机器人仅通过以太网连接、不连接互联网的情况;
  • 已执行出厂重置;
  • 尝试从另一台Nao机器人通过文件传输复制安装文件;
  • 尝试为nao用户赋予管理员权限,但无root用户权限无法操作。

根据文档及当前情况,我认为root用户已被禁止通过SSH连接。现寻求其他连接机器人root用户并安装paho-mqtt的方法,希望有相关经验的用户提供帮助。

命令执行输出

> nao [0] ~ $ su root
Password:
su: Authentication failure
> nao [err 1] ~ $ pip install paho-mqtt
Collecting paho-mqtt
  Using cached https://files.pythonhosted.org/packages/f8/dd/4b75dcba025f8647bc9862ac17299e0d7d12d3beadbf026d8c8d74215c12/paho-mqtt-1.6.1.tar.gz
Installing collected packages: paho-mqtt
  Running setup.py install for paho-mqtt ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-VYAcPd/paho-mqtt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-5pl4_S/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib
    creating build/lib/paho
    copying src/paho/__init__.py -> build/lib/paho
    creating build/lib/paho/mqtt
    copying src/paho/mqtt/subscribeoptions.py -> build/lib/paho/mqtt
    copying src/paho/mqtt/subscribe.py -> build/lib/paho/mqtt
    copying src/paho/mqtt/reasoncodes.py -> build/lib/paho/mqtt
    copying src/paho/mqtt/publish.py -> build/lib/paho/mqtt
    copying src/paho/mqtt/properties.py -> build/lib/paho/mqtt
    copying src/paho/mqtt/packettypes.py -> build/lib/paho/mqtt
    copying src/paho/mqtt/matcher.py -> build/lib/paho/mqtt
    copying src/paho/mqtt/client.py -> build/lib/paho/mqtt
    copying src/paho/mqtt/__init__.py -> build/lib/paho/mqtt
    running egg_info
    writing requirements to src/paho_mqtt.egg-info/requires.txt
    writing src/paho_mqtt.egg-info/PKG-INFO
    writing top-level names to src/paho_mqtt.egg-info/top_level.txt
    writing dependency_links to src/paho_mqtt.egg-info/dependency_links.txt
    reading manifest file 'src/paho_mqtt.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no files found matching 'epl-v10'
    writing manifest file 'src/paho_mqtt.egg-info/SOURCES.txt'
    running install_lib
    creating /usr/lib/python2.7/site-packages/paho
    error: could not create '/usr/lib/python2.7/site-packages/paho': Read-only file system

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-VYAcPd/paho-mqtt/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-5pl4_S/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-VYAcPd/paho-mqtt/
> nao [0] ~ $ pip list
Package         Version
--------------- -----------
asn1crypto      0.24.0
backports-abc   0.4
catkin-pkg      0.2.10
certifi         2018.11.29
cffi            1.11.5
chardet         3.0.4
cryptography    2.3
enum34          1.1.6
fail2ban        0.10.3.fix1
idna            2.7
ipaddress       1.0.22
ndg-httpsclient 0.5.1
numpy           1.14.5
pil-compat      1.0.0
Pillow          3.1.1
pip             18.0
ply             3.11
pyasn1          0.4.4
pycparser       2.18
pycryptodome    3.4.11
pygobject       3.28.3
pyinotify       0.9.6
pyOpenSSL       18.0.0
pyserial        3.4
PySocks         1.6.8
python-dateutil 2.7.3
PyYAML          3.13
requests        2.19.1
setuptools      40.0.0
simplejson      3.16.0
singledispatch  3.4.0.3
six             1.11.0
systemd-python  234
TornadIO2       0.0.3
tornado         4.5.3
urllib3         1.23
vobject         0.9.6.1
> nao [0] ~ $ sudo pip install paho-mqtt
Password:
Sorry, user nao is not allowed to execute '/usr/bin/pip install paho-mqtt' as root on nao.
> nao [err 1] ~ $ sudo pip install paho-mqtt --root /usr/lib/python2.7/site-packages
Password:
Sorry, user nao is not allowed to execute '/usr/bin/pip install paho-mqtt --root /usr/lib/python2.7/site-packages' as root on nao.

内容的提问来源于stack exchange,提问作者Krebskralle

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.21 00:50:12