Hi !
I'm trying to execute a python script to retrieve delivery and engagement statistics on Mailjet. I have convert the response of the API to pandas table, it works find in my IDE but in PAD I have the following error :
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\dhandas\venvs\mailjet2.7\Lib\site-packages\mailjet_rest\__init__.py", line 3, in <module>
File "C:\Users\dhandas\venvs\mailjet2.7\Lib\site-packages\mailjet_rest\client.py", line 4, in <module>
ImportError: No module named json
But I did specify the path for my modules :

And this is my code :
from mailjet_rest import Client
import pandas as pd
import simplejson
# Define the API key and secret
MJ_APIKEY_PUBLIC = my_public_key
MJ_APIKEY_PRIVATE = my_private_key
mailjet = Client(auth=(MJ_APIKEY_PUBLIC, MJ_APIKEY_PRIVATE), version='v3')
# Get the list of campaigns
filters = {
'IDType' : 'campaign',
'limit' : 1000
}
campaigns = mailjet.campaignoverview.get(filters=filters)
campaigns_json = simplejson.dumps(campaigns.json(), indent=4)
campaigns_df = pd.read_json(campaigns_json)
campaigns_df = campaigns_df['Data'].apply(pd.Series)[['ID', 'Subject', 'Title']]
print(campaigns_df)
Thank you for your help !