pimoroni / fanshim-python

Python library for the Fan SHIM for Raspberry Pi
https://shop.pimoroni.com/products/fan-shim
MIT License
295 stars 85 forks source link

module 'psutil' has no attribute 'sensors_temperatures' #33

Closed Dimpelmoser closed 4 years ago

Dimpelmoser commented 5 years ago

... sorry, but I'm still trying to get the Pimoni FanShim running on my RB3+ board with Rootzol's Raspiblitz V1.2.

In the last few days I have unsuccessfully tried different suggestions from the internet. Today I have completely reinstalled the FanShim with the improved Pimoni GitHub files.

However, I always get the following error messages:


admin@PotzBlitz00:~/fanshim-python/examples $ sudo systemctl status pimoroni-fanshim.service â pimoroni-fanshim.service - Fan Shim Service Loaded: loaded (/etc/systemd/system/pimoroni-fanshim.service; enabled; vendor preset: enabled) Active: failed (Result: exit-code) since Fri 2019-08-02 22:56:41 BST; 46min ago Process: 30688 ExecStart=/home/admin/fanshim-python/examples/automatic.py --on-threshold 57 --off-threshold 47 --delay 2 --brightness 255 --preempt (code= Main PID: 30688 (code=exited, status=2) Aug 02 22:56:41 PotzBlitz00 systemd[1]: pimoroni-fanshim.service: Failed with result 'exit-code'. Aug 02 22:56:41 PotzBlitz00 systemd[1]: pimoroni-fanshim.service: Service hold-off time over, scheduling restart. Aug 02 22:56:41 PotzBlitz00 systemd[1]: Stopped Fan Shim Service. Aug 02 22:56:41 PotzBlitz00 systemd[1]: pimoroni-fanshim.service: Start request repeated too quickly. Aug 02 22:56:41 PotzBlitz00 systemd[1]: Failed to start Fan Shim Service. Aug 02 22:56:41 PotzBlitz00 systemd[1]: pimoroni-fanshim.service: Unit entered failed state. Aug 02 22:56:41 PotzBlitz00 systemd[1]: pimoroni-fanshim.service: Failed with result 'exit-code'.


admin@PotzBlitz00:~/fanshim-python/examples $ sudo python3 automatic.py Traceback (most recent call last): File "automatic.py", line 65, in t = get_cpu_temp() File "automatic.py", line 24, in get_cpu_temp return psutil.sensors_temperatures()['cpu-thermal'][0].current AttributeError: module 'psutil' has no attribute 'sensors_temperatures'


... I am a bit frustrated at the moment ...

Gadgetoid commented 5 years ago

Might be worth running a sudo pip3 install --upgrade psutil and see if it helps. The documentation suggests the sensors_temperatures feature was added in psutil version 5.1.0.

If this works, it's probably something I need to verify in the installer.