Python psutil psutil.get_process_list () error

I am trying to do something with python psutil but getting a weird error.

procs = psutil.get_process_list()

Gets the following error:

AttributeError: 'module' object has no attribute 'get_process_list'

The only thing I found in this: https://github.com/giampaolo/psutil/issues/524

But there is no real solution except pasting it into another directory (which I tried, but it doesn’t work for me). Does anyone know why I am getting this error?

Thanks so much in advance!

+4
source share
2 answers

After checking the documentation here , I do not see the function get_process_list()in psutil, it is deprecated according to this .

Maybe you should try the - process_iter()- documentation here

, .

list(..) ( - , ) for, ( , ).

-

for proc in psutil.process_iter():
    <do your logic>

, -

procs = list(psutil.process_iter())
+8

HISTORY.rst,

# 273: psutil.get_process_list() .

psutil.process_iter():

procs = list(psutil.process_iter())
+1

All Articles