Jahaja / psdash

A linux system information web dashboard using psutils and flask
Creative Commons Zero v1.0 Universal
2.42k stars 325 forks source link

AttributeError: 'ModuleWrapper' object has no attribute 'get_boot_time' #26

Closed ebin123456 closed 10 years ago

ebin123456 commented 10 years ago

got an error from psutil.get_boot_time() function it working for me when i replaced psutil.get_boot_time() by psutil.BOOT_TIME here

@psdashapp.route("/")
def index():
    load_avg = os.getloadavg()
    uptime = datetime.now() - datetime.fromtimestamp(psutil.get_boot_time())
Jahaja commented 10 years ago

Sounds strange, what version of psutil are you using?

ebin123456 commented 10 years ago

i am using Python 2.7.3 and

>>> psutil.__version__
'2.1.1'

in ubuntu

Jahaja commented 10 years ago

Ah, that explains it. psdash currently requires psutil 1.2.1. I suggest you install psdash in a virtualenv. I'll look into what needs to be done to use a newer version of psutil, but it's currently not a pressing issue. I know that it will require a few changes.

ebin123456 commented 10 years ago

okay. it will be great if you can include about required version of psutil in README.md

anyway thanks for your fast response

Jahaja commented 10 years ago

The requirements is currently decided by setup.py which is set as following:

install_requires=[
    "Flask==0.10.1",
    "psutil==1.2.1",
    "argparse==1.2.1",
    "glob2==0.4.1"
],

I would like pip install/easy_install to fail or at least give a clear warning when an exact version is set as above. But I'm not sure it does.

Jahaja commented 10 years ago

psdash is now using psutil 2.1.1 (3ecb1727b9be1672fe95ffa526384e3b553baaf2). It will come out in the next release, probably 0.4.0.