我从网上下载了WebIOPi-0.6.0.tar.gz并将其解压缩并运行setup.sh。安装完成后,当我运行sudo webiopi
时,它显示了这个..
ralph@ralph-desktop:~$ sudo webiopi
Traceback (most recent call last):
File "/usr/lib/python3.5/runpy.py", line 174, in _run_module_as_main mod_name, mod_spec, code = _get_module_details(mod_name, _Error)
File "/usr/lib/python3.5/runpy.py", line 133, in _get_module_details return _get_module_details(pkg_main_name, error)
File "/usr/lib/python3.5/runpy.py", line 109, in _get_module_details __import__(pkg_name)
File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.6.0-py3.5-linux-armv7l.egg/webiopi/__init__.py", line 17, in <module>
import _webiopi.GPIO as GPIO
_webiopi.GPIO.SetupException: This module can only be run on a Raspberry Pi!
什么似乎错了?我试图重新安装它,但问题仍然存在。
我通过@Codino运行代码并得到了这个结果。
ralph@ralph-desktop:~/WebIOPi-0.7.1$ sudo webiopi
2016-07-21 03:11:12 - WebIOPi - INFO - Starting WebIOPi/0.7.22/Python3.5
2016-07-21 03:11:12 - WebIOPi - INFO - GPIO - Native mapped to REST API /GPIO
2016-07-21 03:11:12 - WebIOPi - INFO - DigitalActuator - LightSwitch mapped to REST API /devices/IJFottwtJsEzH8wF
2016-07-21 03:11:12 - WebIOPi - WARNING - Access unprotected
2016-07-21 03:11:12 - WebIOPi - ERROR - [Errno 98] Address already in use
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/protocols/http.py", line 45, in __init__
BaseHTTPServer.HTTPServer.__init__(self, ("", port), HTTPHandler)
File "/usr/lib/python3.5/socketserver.py", line 440, in __init__
self.server_bind()
File "/usr/lib/python3.5/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/lib/python3.5/socketserver.py", line 454, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/__main__.py", line 77, in <module>
main(sys.argv)
File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/__main__.py", line 70, in main
server = Server(port=port, configfile=configfile, scriptfile=scriptfile)
File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/server/__init__.py", line 120, in __init__
self.http_server = http.HTTPServer(self.host, http_port, self.restHandler, context, docroot, index, auth, realm)
File "/usr/local/lib/python3.5/dist-packages/WebIOPi-0.7.22-py3.5-linux-armv7l.egg/webiopi/protocols/http.py", line 48, in __init__
BaseHTTPServer.HTTPServer.__init__(self, ("", port), HTTPHandler)
File "/usr/lib/python3.5/socketserver.py", line 440, in __init__
self.server_bind()
File "/usr/lib/python3.5/http/server.py", line 138, in server_bind
socketserver.TCPServer.server_bind(self)
File "/usr/lib/python3.5/socketserver.py", line 454, in server_bind
self.socket.bind(self.server_address)
OSError: [Errno 98] Address already in use
答案 0 :(得分:0)
因为您使用的版本不兼容。 试试this。
$ wget http://sourceforge.net/projects/webiopi/files/WebIOPi-0.7.1.tar.gz
$ tar xvzf WebIOPi-0.7.1.tar.gz
$ cd WebIOPi-0.7.1
$ wget https://raw.githubusercontent.com/doublebind/raspi/master/webiopi-pi2bplus.patch
$ patch -p1 -i webiopi-pi2bplus.patch
$ sudo ./setup.sh