Skip to content
This repository was archived by the owner on Oct 22, 2025. It is now read-only.
This repository was archived by the owner on Oct 22, 2025. It is now read-only.

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

@roshnaeem

Description

@roshnaeem

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)"
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions