3

I am trying to get cpu temperature using psutil module. I installed it using

pip install psutil

It installed perfectly fine. However, when I try to import it I get the following error.

Traceback (most recent call last):
File "<pyshell#4>", line 1, in <module>
import psutil
File "C:\Users\Awais\AppData\Roaming\Python\Python37\site-packages\psutil\__init__.py", line 147, 
in <module>
from . import _pswindows as _psplatform
File "C:\Users\Awais\AppData\Roaming\Python\Python37\site-packages\psutil\_pswindows.py", line 35, in 
<module>
from ._psutil_windows import ABOVE_NORMAL_PRIORITY_CLASS
ModuleNotFoundError: No module named 'psutil._psutil_windows'

2 Answers2

1

I solved a similar problem by downgrading my psutil from version 5.7.0 to 4.1.0 using the following command:

pip install psutil==4.1.0

I'm not sure what the actual reason for this error is. Perhaps an incompatibility with your python version? In my case, I was using Python 3.5.4.

Ranosama
  • 639
  • 5
  • 10
0

You can install psutil manually by using the prebuilt wheel from Gohlke's collection https://www.lfd.uci.edu/~gohlke/pythonlibs/#psutil

To install manually (from cmd or Powershell) use:

pip install C:\Users\me\Downloads\psutil‑5.9.0‑cp311‑cp311‑win_amd64.whl
Jansen Simanullang
  • 1,405
  • 14
  • 11