Skip to content

ImportError: cannot import name 'jtop' #228

@AnamikaPaul

Description

@AnamikaPaul

Describe the bug
When i run this code it doesnt get jtop and shows error. i have already installed jtop

from jtop import jtop
import json, datetime

if name == "main":

with jtop() as jetson:
        # jetson.stats provides our system measurements as type dict.
        tmp = jetson.stats  
        # time and uptime are proved as time objects. These needed to be converted before passing as a JSON string,
        tmp["time"] = str(tmp["time"].strftime('%m/%d/%Y'))
        tmp["uptime"] = str(tmp["uptime"])
        # We then convert our dict -> Json string
        influx_json= {"jetson": tmp}
        print(json.dumps(influx_json), flush=True)

To Reproduce

python3 jtop.py
Traceback (most recent call last):
File "jtop.py", line 8, in
from jtop import jtop
File "/home/anamika/Downloads/yolo_5/jtop.py", line 8, in
from jtop import jtop
ImportError: cannot import name 'jtop'
anamika@anamika-desktop:~/Downloads/yolo_5$ python3 --version
Python 3.6.9

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions