Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crashes at launch on macOS: psutil doesn't have sensors_temperatures #49

Open
williamleuschner opened this issue Nov 8, 2017 · 6 comments
Assignees
Labels

Comments

@williamleuschner
Copy link

Step 1: Describe your environment

  • System (Intel/AMD/Raspberry Pi etc): Intel core i5, MacBook Air 6,2
  • OS version: macOS 10.13.1
  • s-tui version: 0.6.7
  • Installation method(pip/PPA/source code): pip

Step 2: Describe the problem:

s-tui crashes immediately after launch with the below traceback.

Observed Results:

  Traceback (most recent call last):
  File "/usr/local/bin/s-tui", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.6/site-packages/s_tui/s_tui.py", line 679, in main
    graph_controller = GraphController(args)
  File "/usr/local/lib/python3.6/site-packages/s_tui/s_tui.py", line 522, in __init__
    self.view = GraphView(self, args)
  File "/usr/local/lib/python3.6/site-packages/s_tui/s_tui.py", line 207, in __init__
    self.temp_sensors_menu = TempSensorsMenu(self.on_sensors_menu_close)
  File "/usr/local/lib/python3.6/site-packages/s_tui/TempSensorsMenu.py", line 67, in __init__
    sensors_dict = psutil.sensors_temperatures()
AttributeError: module 'psutil' has no attribute 'sensors_temperatures'

Debug Results, output of s-tui -d created in a file _s-tui.log:

2017-11-08 10:14:58,334 [main()] [INFO ]  Started without root permissions
2017-11-08 10:14:58,340 [__init__()] [DEBUG]  stress-ng is not installed

Step 3: Reproduce the problem:

Occurs without fail at program launch on macOS.

Steps to reproduce:

  1. pip install s-tui
  2. brew install stress
  3. s-tui
@amanusk
Copy link
Owner

amanusk commented Nov 8, 2017

Thank you for the thorough bug report.
The issue has been patched here but it is not yet in the latest release version. You are welcome to try cloning and running s-tui from source in the mean time.
The bigger problem is that temperature reading for macOS is not yet available #27, and I am currently unable to address the issue without a working mac box (I am working on it).

@amanusk amanusk added the bug label Nov 8, 2017
amanusk pushed a commit that referenced this issue Nov 9, 2017
* Addresses issue #49, crash on start
* Add more fine grained exception handling
@amanusk
Copy link
Owner

amanusk commented Nov 9, 2017

A fix was uploaded to PyPi.
Please try updating s-tui with pip install s-tui --upgrade

@aanari
Copy link

aanari commented Dec 10, 2017

It still fails on Mac OSX, here is the stack trace (I followed the same instructions as @williamleuschner):

$ s-tui
Traceback (most recent call last):
  File "/usr/local/bin/s-tui", line 11, in <module>
    load_entry_point('s-tui==0.6.7.2', 'console_scripts', 's-tui')()
  File "/usr/local/lib/python2.7/site-packages/s_tui/s_tui.py", line 679, in main
    graph_controller = GraphController(args)
  File "/usr/local/lib/python2.7/site-packages/s_tui/s_tui.py", line 522, in __init__
    self.view = GraphView(self, args)
  File "/usr/local/lib/python2.7/site-packages/s_tui/s_tui.py", line 216, in __init__
    urwid.WidgetPlaceholder.__init__(self, self.main_window())
  File "/usr/local/lib/python2.7/site-packages/s_tui/s_tui.py", line 464, in main_window
    temp_source = TemperatureSource(self.custom_temp)
  File "/usr/local/lib/python2.7/site-packages/s_tui/Sources/TemperatureSource.py", line 43, in __init__
    self.update() # Initial update
  File "/usr/local/lib/python2.7/site-packages/s_tui/Sources/TemperatureSource.py", line 75, in update
    last_value = psutil.sensors_temperatures()['coretemp'][0].current
AttributeError: 'module' object has no attribute 'sensors_temperatures'

@amanusk
Copy link
Owner

amanusk commented Dec 10, 2017

@aanari Thanks for the update.
An AttributeError exception was added to both temperature and fan sensors. This should prevent the crash. These metrics are not yet available in psutil for macOS but are hopefully coming soon. psutil-#371.

@shadowwalkersteam
Copy link

It is still happening. I'm also getting the same exception on macOS.

@wnz99
Copy link

wnz99 commented May 12, 2022

Getting the same error on macOS.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants