Up wiringpi エラー 作成: 2021-05-13
更新: 2021-05-13


    daiarg版 detect.py は wiring2 を使う。

    wiring2 は,インストールされていない:
      (venv) $ pip show wiringpi2 WARNING: Package(s) not found: wiringpi2

    プログラム中の wiring2 を wiring に変更すると,つぎのエラーが返される:
      (venv) $ ./detect_daiarg.py pinMode PWM: Unable to do this when using /dev/gpiomem. Try sudo?

    wiringpi のバージョンの変更では,エラーは無くならない:
      (venv) $ pip show wiringpi  ‥‥ Version: 2.60.1  ‥‥ (venv) $ pip uninstall wiringpi Found existing installation: wiringpi 2.60.1 Not uninstalling wiringpi at /usr/local/lib/python3.7/dist-packages/ wiringpi-2.60.1-py3.7-linux-armv7l.egg, outside environment /home/pi/venv Can't uninstall 'wiringpi'. No files were found to uninstall. (venv) $ sudo pip uninstall wiringpi Uninstalling wiringpi-2.60.1: Would remove: /usr/local/lib/python3.7/dist-packages/ wiringpi-2.60.1-py3.7-linux-armv7l.egg Proceed (y/n)? y Successfully uninstalled wiringpi-2.60.1 (venv) $ pip install wiringpi==2.46 Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting wiringpi==2.46 Downloading https://www.piwheels.org/simple/ wiringpi/wiringpi-2.46.0-cp37-cp37m-linux_armv7l.whl (306 kB) |████████████████████████████████| 306 kB 122 kB/s Installing collected packages: wiringpi Successfully installed wiringpi-2.46.0 (venv) $ ./detect_daiarg.py pinMode PWM: Unable to do this when using /dev/gpiomem. Try sudo?

    wiringpi を元のバージョンに戻す:
      (venv) pip uninstall wiringpi (venv) pip install wiringpi  ‥‥ Successfully installed wiringpi-2.60.1

    よって,wiringpi2 をインストール:
      (venv) $ pip install wiringpi2 Collecting wiringpi2 Downloading https://www.piwheels.org/simple/ wiringpi2/wiringpi2-2.32.3-py3-none-any.whl (2.5 kB) Requirement already satisfied: wiringpi>=2.23.1 in /home/pi/venv/lib/python3.7/site-packages (from wiringpi2) (2.60.1) Installing collected packages: wiringpi2 Successfully installed wiringpi2-2.32.3
    しかしつぎのようになる:
      (venv) $ ./detect_daiarg.py ./detect_daiarg.py:13: DeprecationWarning: The wiringpi2 module has been deprecated, please 'import wiringpi' instead. import wiringpi2 as wiringpi pinMode PWM: Unable to do this when using /dev/gpiomem. Try sudo?

    wiringpi2 を削除:
      (venv) $ pip uninstall wiringpi2 Found existing installation: wiringpi2 2.32.3 Uninstalling wiringpi2-2.32.3: Would remove: /home/pi/venv/lib/python3.7/site-packages/wiringpi2-2.32.3.dist-info/* /home/pi/venv/lib/python3.7/site-packages/wiringpi2.py Proceed (y/n)? y Successfully uninstalled wiringpi2-2.32.3