linusg / rpi-backlight

🔆 A Python module for controlling power and brightness of the official Raspberry Pi 7" touch display
https://rpi-backlight.readthedocs.io
MIT License
276 stars 32 forks source link

ModuleNotFoundError: No module named 'rpi_backlight' #17

Closed allendevans closed 5 years ago

allendevans commented 5 years ago

Pasting our email conversation. Will backfill/improve if missing critical information.


Allen

I'm instalilng rpi-backlight on an RPI 3B+ w/ the Buster release and experiencing problems. Have others reported problems, too?

After installation and update to the $SUBSYSTEM variable, I receive the follwing error message:

pi@piconsole:~/.local/lib/python3.7/site-packages/rpi_backlight $ sudo rpi-backlight -n 50
Traceback (most recent call last):
  File "/bin/rpi-backlight", line 6, in <module>
    from rpi_backlight.cli import main
ModuleNotFoundError: No module named 'rpi_backlight'

Please advise.


Linus

Have others reported problems, too?

I'm afraid not. I'll need more info what exactly have you done prior execution, please open an issue on GitHub: https://github.com/linusg/rpi-backlight/issues?q=is%3Aissue+is%3Aopen+sort%3Aupdated-desc

For example I'm not sure what the file /bin/rpi-backlight does.


Allen

I can explain the /bin/rpi-backlight.  The .profile $PATH didn't (seemingly) recognize/follow the  $HOME/.local/bin path (I don't have .bash_login or .bash_profile config files in ~), so I copied rpi-backlight to the /bin directory.  

The installation was conducted per the instructions on the github website, i.e., "pip3 install rpi-backlight" (or similar).  The SD is new with a fresh, full Raspian install.  

linusg commented 5 years ago

I believe running rpi-backlight as root requires a slightly different installation process - and isn't recommended nor necessary after creating the udev rule.

Please try running without sudo.

Btw, -n is not a valid option in either v1 or v2 - see https://rpi-backlight.readthedocs.io/en/latest/usage.html#command-line-interface

allendevans commented 5 years ago

Linus,

You are correct, on both fronts. (sudo, -n)

Last night, I used sudo as a fallback when initially receiving errors (not shown above). Since then, I've rebooted the system several times and the CLI and GUI now work flawleslly.

Thank you ... Allen.

linusg commented 5 years ago

I'm glad the issue could be resolved @allendevans! Feel free to get in touch if you have further questions.