Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
print CPU temperature
#1
Hello please can someone help me with example of code that prints out CPU temperature ?

Thank you a lot.
Reply
#2
pyspectator
Reply
#3
Hello thank you for reply. I cant istall this. Iam getting error in CMD.

C:\Users\Samuel>pip3 install pyspectator
Collecting pyspectator
  Using cached pyspectator-1.2.1.tar.gz (12 kB)
    ERROR: Command errored out with exit status 1:
     command: 'c:\users\samuel\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-install-vaq4zs9d\\pyspectator\\setup.py'"'"'; __file__='"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-install-vaq4zs9d\\pyspectator\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Samuel\AppData\Local\Temp\pip-install-vaq4zs9d\pyspectator\pip-egg-info'
         cwd: C:\Users\Samuel\AppData\Local\Temp\pip-install-vaq4zs9d\pyspectator\
    Complete output (1 lines):
    error in pyspectator setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid requirement, parse error at "'-r base.'"
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
WARNING: You are using pip version 20.0.2; however, version 20.1.1 is available.
You should consider upgrading via the 'c:\users\samuel\appdata\local\programs\python\python38-32\python.exe -m pip install --upgrade pip' command.
Reply
#4
update pip
Reply
#5
Also last commit was on Dec 26, 2017
Reply
#6
I tested it in Linux, it works.

from pyspectator.processor import Cpu

cpu = Cpu(monitoring_latency=1)
print(f'Temp: {cpu.temperature} °C')
Reply
#7
Hello guys i just can not install this extension. Iam always getting error like this in my CMD.


C:\Users\Samuel>pip install pyspectator
Collecting pyspectator
Using cached pyspectator-1.2.1.tar.gz (12 kB)
ERROR: Command errored out with exit status 1:
command: 'c:\users\samuel\appdata\local\programs\python\python38-32\python.exe' -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-install-kdmiqrqc\\pyspectator\\setup.py'"'"'; __file__='"'"'C:\\Users\\Samuel\\AppData\\Local\\Temp\\pip-install-kdmiqrqc\\pyspectator\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Samuel\AppData\Local\Temp\pip-pip-egg-info-ykshe6qi'
cwd: C:\Users\Samuel\AppData\Local\Temp\pip-install-kdmiqrqc\pyspectator\
Complete output (1 lines):
error in pyspectator setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid requirement, parse error at "'-r base.'"
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

C:\Users\Samuel>
Reply
#8
better use a Windows commandline tool with Popen
Reply
#9
Iam sorry but iam not able to install this extension. I have installed over 100 python extensions but this one just not woring.
Reply
#10
There is a issue report try follow the last post.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Help gathering Temperature from API response road102 5 1,081 Dec-16-2022, 08:30 PM
Last Post: road102
  get data (temperature and humidity) from DHT22 into CSV and sending them over the net apollo 0 3,865 Apr-16-2021, 07:49 PM
Last Post: apollo
  monitoring the temperature of the CPU with Python apollo 2 8,771 Apr-13-2021, 05:39 PM
Last Post: apollo
  Read temperature once mada72 2 2,796 Apr-28-2019, 07:18 PM
Last Post: mada72
  Importing a temperature converting module RedSkeleton007 2 8,047 Nov-12-2017, 01:20 PM
Last Post: sparkz_alot
  Temperature Code help? 20AJ0931 2 6,552 Apr-08-2017, 12:35 AM
Last Post: snippsat
  Temperature value code 20AJ0931 10 13,514 Mar-19-2017, 11:05 PM
Last Post: 20AJ0931

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020