question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG]ZeroDivisionError: integer division or modulo by zero

See original GitHub issue

Describe the bug

At startup i get the error: ZeroDivisionError: integer division or modulo by zero

To Reproduce

Start bpytop

Expected behavior

start normaly

Screenshots


Info (please complete the following information):

  • bpytop version: bpytop -v bpytop version: 1.0.50

  • psutil version: bpytop -v (version 5.7.0 or above is required) psutil version: 5.7.3

  • (Linux) Linux distribution and version: Linux version 4.19.107-Unraid (root@Develop) (gcc version 9.2.0 (GCC)) #1 SMP Thu Mar 5 13:55:57 PST 2020

  • (OSX/FreeBSD) Os release version:


  • Terminal used: terminator

  • Font used: Ubuntu Regular 11

  • Python version, python3 --version (version 3.6 or above is required): Python 3.9.0

Additional context

contents of ~/.config/bpytop/error.log

27/11/20 (01:35:56) | ERROR: Data collection thread failed with exception: integer division or modulo by zero
Traceback (most recent call last):
  File "/usr/lib64/python3.9/site-packages/bpytop.py", line 2600, in _runner
    collector._draw()
  File "/usr/lib64/python3.9/site-packages/bpytop.py", line 2873, in _draw
    CpuBox._draw_fg()
  File "/usr/lib64/python3.9/site-packages/bpytop.py", line 1752, in _draw_fg
    out += (f'{THEME.inactive_fg} ⡀⡀⡀⡀⡀{Mv.l(5)}{THEME.gradient["temp"][min_max(cpu.cpu_temp[0][-1], 0, cpu.cpu_temp_crit) * 100 // cpu.cpu_temp_crit]}{Graphs.temps[0](None if cls.resized else cpu.cpu_temp[0][->
ZeroDivisionError: integer division or modulo by zero
27/11/20 (01:35:57) | WARNING: Exiting with errorcode (1). Runtime 0:00:02

(try running bpytop with --debug flag if error.log is empty)

hope i get all right 😃 when you need additional information feel free to ask 😃

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
aristocratoscommented, Dec 19, 2020

@wuast94 Should be fixed in v1.0.51

0reactions
wuast94commented, Dec 3, 2020

python3 -c “import psutil; print(psutil.sensors_temperatures())”:

{'nct6779': [
shwtemp(label='SYSTIN', current=30.0, high=80.0, critical=80.0), 
shwtemp(label='PCH_CPU_TEMP', current=0.0, high=None, critical=None), 
shwtemp(label='CPUTIN', current=32.0, high=80.0, critical=80.0), 
shwtemp(label='AUXTIN0', current=15.0, high=None, critical=None), 
shwtemp(label='AUXTIN1', current=34.0, high=None, critical=None), 
shwtemp(label='AUXTIN2', current=22.0, high=None, critical=None), 
shwtemp(label='AUXTIN3', current=-29.0, high=0.0, critical=None), 
shwtemp(label='SMBUSMASTER 0', current=50.0, high=None, critical=None), 
shwtemp(label='PCH_CHIP_CPU_MAX_TEMP', current=0.0, high=None, critical=None), 
shwtemp(label='PCH_CHIP_TEMP', current=0.0, high=None, critical=None)
]}

sensors:

nct6779-isa-0290
Adapter: ISA adapter
Vcore:         472.00 mV (min =  +0.00 V, max =  +1.74 V)
in1:             1.28 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
AVCC:            3.31 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
+3.3V:           3.30 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in4:             1.86 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in5:             1.03 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in6:             1.21 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
3VSB:            3.42 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
Vbat:            3.28 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in9:             0.00 V  (min =  +0.00 V, max =  +0.00 V)
in10:          856.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in11:            1.08 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in12:            1.70 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
in13:          928.00 mV (min =  +0.00 V, max =  +0.00 V)  ALARM
in14:            1.86 V  (min =  +0.00 V, max =  +0.00 V)  ALARM
Array Fan:        0 RPM  (min =    0 RPM)
fan2:          1156 RPM  (min =    0 RPM)
MB Temp:        +30.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
CPU Temp:       +33.0°C  (high = +80.0°C, hyst = +75.0°C)  sensor = thermistor
AUXTIN0:        +15.0°C    sensor = thermistor
AUXTIN1:        +34.0°C    sensor = thermistor
AUXTIN2:        +22.0°C    sensor = thermistor
AUXTIN3:        -29.0°C  (high =  +0.0°C, hyst =  +0.0°C)  sensor = thermistor
SMBUSMASTER 0:  +54.5°C  
intrusion0:    ALARM
intrusion1:    ALARM
beep_enable:   disabled
Read more comments on GitHub >

github_iconTop Results From Across the Web

integer division or modulo by zero i cant see any error - Stack ...
The variable i is defined in range(0,z), it always starts from zero. Mathematically the module of zero is undefined, that's why you're ...
Read more >
integer division or modulo by zero" error. How do I solve it?
The error is integer division or modulo by zero. Your code uses modulo by zero. What is the point of checking that? def...
Read more >
ZeroDivisionError: division by zero - Net-Informations.Com
ZeroDivisionError is a built-in Python exception thrown when a number is divided by 0. This means that the exception raised when the second...
Read more >
[Solved] ZeroDivisionError: integer division or modulo by zero
The error message is self explanatory: You are dividing (or taking the modulus of) a value by zero. If the error reports a...
Read more >
ZeroDivisionError: division by zero - Yawin Tutor
The zero division error is due to either a number being divided by zero, or a number being modulo by zero. The denominator...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found