求助:树莓派+pyhton,运行报错: Blinker.mode("BLINKER_WIFI")-Arduino中文社区 - Powered by Discuz! Archiver

th586 发表于 2020-9-21 18:26

求助:树莓派+pyhton,运行报错: Blinker.mode("BLINKER_WIFI")

求助:
   树莓派4B+python3.7.3
   已根据要求安装以下依赖的库:
git clone https://github.com/blinker-iot/blinker-py
cd blinker-py
sudo python3 setup.py install
sudo pip3 install -r requirements.txt

结果运行示例程序时,出现报错如下:

用的是【阿里云】的中介



Traceback (most recent call last):
File "/home/pi/ex/_liwei/点灯示例.py", line 8, in <module>
    Blinker.mode("BLINKER_WIFI")
File "/usr/local/lib/python3.7/dist-packages/Blinker-0.2.0-py3.7.egg/Blinker/Blinker.py", line 123, in mode
    bProto.conn2 = bProto.proto2.WebSocketServer(BLINKER_DIY_MQTT)
File "/usr/local/lib/python3.7/dist-packages/Blinker-0.2.0-py3.7.egg/BlinkerAdapters/BlinkerLinuxWS.py", line 81, in __init__
    self.server = SimpleWebSocketServer(self.name, self.port, HandleServer)
File "/usr/local/lib/python3.7/dist-packages/SimpleWebSocketServer/SimpleWebSocketServer.py", line 602, in __init__
    self.serversocket.bind(hostInfo)
PermissionError: Permission denied


不知道是配置错误。还是系统错误,请指点:hug:

奈何col 发表于 2020-9-21 19:18

运行的时候需要sudo

th586 发表于 2020-9-21 21:01

奈何col 发表于 2020-9-21 19:18
运行的时候需要sudo

非常感谢,终于解决大问题了。

调试了一下午没搞定

AFATAR 发表于 2022-3-20 12:42

奈何col 发表于 2020-9-21 19:18
运行的时候需要sudo

树莓派运行示例程序时报错,请问如何解决?错误信息如下:
Traceback (most recent call last):
File "example.py", line 6, in <module>
    from blinker import Device, ButtonWidget, NumberWidget
File "/usr/local/lib/python3.7/dist-packages/blinker/__init__.py", line 6, in <module>
    from .device import *
File "/usr/local/lib/python3.7/dist-packages/blinker/device.py", line 70
    def __init__(self, /, **kw):
                     ^
SyntaxError: invalid syntax
页: [1]
查看完整版本: 求助:树莓派+pyhton,运行报错: Blinker.mode("BLINKER_WIFI")