【问题标题】:raspberrypi uwsgi[503]: ModuleNotFoundError: No module named 'RPi'raspberrypi uwsgi [503]:ModuleNotFoundError:没有名为“RPi”的模块
【发布时间】:2020-06-20 18:33:41
【问题描述】:

我正在制作一个由raspberry pi 控制的网络服务器,所以我的朋友可以通过我的网络域远程控制机器人。

遵循this 教程后,我设法让网站运行到自动加载点。但现在我收到以下错误:

Jun 20 18:19:14 raspberrypi uwsgi[503]: Traceback (most recent call last):
Jun 20 18:19:14 raspberrypi uwsgi[503]: File "./flask-control.py", line 9, in <module>
Jun 20 18:19:14 raspberrypi uwsgi[503]: import RPi.GPIO as GPIO
Jun 20 18:19:14 raspberrypi uwsgi[503]: ModuleNotFoundError: No module named 'RPi'
Jun 20 18:19:14 raspberrypi uwsgi[503]: unable to load app 0 (mountpoint='') (callable not found or import error)
Jun 20 18:19:14 raspberrypi uwsgi[503]: *** no app loaded. going in full dynamic mode ***
Jun 20 18:19:14 raspberrypi uwsgi[503]: *** uWSGI is running in multiple interpreter mode ***
Jun 20 18:19:14 raspberrypi uwsgi[503]: spawned uWSGI master process (pid: 503)
Jun 20 18:19:14 raspberrypi uwsgi[503]: spawned uWSGI worker 1 (pid: 687, cores: 2)
Jun 20 18:22:22 raspberrypi systemd[1]: Started uWSGI Service.

我确实安装了RPi,因为我一直在使用没有网络服务器的烧瓶。

干杯!

【问题讨论】:

  • 教程的哪个步骤中的“自动加载部分”是指?

标签: python nginx flask raspberry-pi uwsgi


【解决方案1】:

事实证明,您需要以 root 而非用户身份安装 RPi,然后授予教程中创建的 www-data 用户使用 GPIO 引脚的权限。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-03-28
    • 1970-01-01
    • 2022-01-07
    • 2017-12-14
    • 2020-12-10
    相关资源
    最近更新 更多