suhanna / System_info

MIT License
7 stars 6 forks source link

Key Error: 'brand' #7

Closed michaeljmcint closed 3 years ago

michaeljmcint commented 3 years ago

When using the module a Key Error is thrown and the process halts.

Traceback (most recent call last):
  File "proc.py", line 4, in <module>
    from system_info import sysinfo
  File "/miniforge3/lib/python3.9/site-packages/system_info/sysinfo.py", line 230, in <module>
    sysInfo = os_info.systemSpec()
  File "/miniforge3/lib/python3.9/site-packages/system_info/sysinfo.py", line 55, in systemSpec
    data["Processor"] = cinfo['brand']
KeyError: 'brand'

'brand' versus 'brand_raw' for the get_cpu_info() dictionary key.

https://github.com/suhanna/System_info/blob/master/system_info/sysinfo.py#L55

miniforge3/envs/myenv/lib/python3.9/site-packages/system_info/sysinfo.py

        cinfo = cpuinfo.get_cpu_info()
        data = {}
        data["Processor"] = cinfo['brand']

Edit: system-info 2.0.0 pypi_0 pypi

RedstonedLife commented 3 years ago

This was fixed in #3 . Its a simple misname, please update your system_info library Using python -m pip install --update system_info

doubleailes commented 2 years ago

This error is still present in the latest version in PyPi repo.

RedstonedLife commented 2 years ago

This error is still present in the latest version in PyPi repo.

Mind sending a stacktrace?

sethtallen commented 2 years ago

Yes, issue is still prevalent in PyPi repo.