Breakend / experiment-impact-tracker

MIT License
266 stars 31 forks source link

unable to import ImpactTracker from experiment_impact_tracker because of pandas error. #82

Open roshnaeem opened 4 months ago

roshnaeem commented 4 months ago

Importing ImpactTracker from experiment_impact_tracker is throwing error for json_normalize. It is outdated and needs to be modified in the code to match with the current version of pandas. This line needs to be changed to fix the error thrown by pandas.

{
    "name": "ImportError",
    "message": "cannot import name 'json_normalize' from 'pandas.io.json' (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/io/json/__init__.py)",
    "stack": "---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Cell In[6], line 1
----> 1 from experiment_impact_tracker.compute_tracker import ImpactTracker

File /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/experiment_impact_tracker/compute_tracker.py:23
     21 import psutil
     22 from experiment_impact_tracker.cpu import rapl
---> 23 from experiment_impact_tracker.data_utils import *
     24 from experiment_impact_tracker.cpu.common import get_my_cpu_info
     25 from experiment_impact_tracker.cpu.intel import get_rapl_power

File /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/experiment_impact_tracker/data_utils.py:3
      1 import pickle
      2 import ujson as json
----> 3 from pandas.io.json import json_normalize
      4 from datetime import datetime
      5 import os

ImportError: cannot import name 'json_normalize' from 'pandas.io.json' (/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pandas/io/json/__init__.py)"
}
roshnaeem commented 4 months ago

i just checked prs, as this issue has been already addressed in https://github.com/Breakend/experiment-impact-tracker/pull/77. @Breakend, can you please merge it.