close

[Solved] json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

Hello Guys, How are you all? Hope You all Are Fine. Today I get the following error json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) in python. So Here I am Explain to you all the possible solutions here.

Without wasting your time, Let’s start This Article to Solve This Error.

How json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) Error Occurs?

Today I get the following error json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) in python.

How To Solve json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) Error ?

  1. How To Solve json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) Error ?

    To Solve json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) Error You had too many braces in your JSON data! And it was missing a double-quote. Here's a repaired version, along with some json loading and dumping code to test it.

  2. json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)

    To Solve json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1) Error You had too many braces in your JSON data! And it was missing a double-quote. Here's a repaired version, along with some json loading and dumping code to test it.

Solution 1

You had too many braces in your JSON data! And it was missing a double-quote. Here’s a repaired version, along with some json loading and dumping code to test it.

import json

data = '''
{
"Transaction_1": {"Name":"Magnolia","Location":"Ayilon male","Amount":289,"Date":"5/5/18"},
"Transaction_2": {"Name":"Landver","Location":"Cinima-city Ramat-hashron","Amount":15,"Date":"15/5/18"},
"Transaction_3": {"Name":"Superfarm","Location":"Shivat-hacochvim male","Amount":199,"Date":"7/5/18"},
"Transaction_4": {"Name":"Printing solutions","Location":"Afeka tel-aviv","Amount":16,"Date":"25/5/18"}
}'''


obj = json.loads(data)
print(obj)

print('- ' * 20)

# Convert back to JSON for nicer printing
print(json.dumps(obj, indent=4))

output

{'Transaction_1': {'Name': 'Magnolia', 'Location': 'Ayilon male', 'Amount': 289, 'Date': '5/5/18'}, 'Transaction_2': {'Name': 'Landver', 'Location': 'Cinima-city Ramat-hashron', 'Amount': 15, 'Date': '15/5/18'}, 'Transaction_3': {'Name': 'Superfarm', 'Location': 'Shivat-hacochvim male', 'Amount': 199, 'Date': '7/5/18'}, 'Transaction_4': {'Name': 'Printing solutions', 'Location': 'Afeka tel-aviv', 'Amount': 16, 'Date': '25/5/18'}}
- - - - - - - - - - - - - - - - - - - - 
{
    "Transaction_1": {
        "Name": "Magnolia",
        "Location": "Ayilon male",
        "Amount": 289,
        "Date": "5/5/18"
    },
    "Transaction_2": {
        "Name": "Landver",
        "Location": "Cinima-city Ramat-hashron",
        "Amount": 15,
        "Date": "15/5/18"
    },
    "Transaction_3": {
        "Name": "Superfarm",
        "Location": "Shivat-hacochvim male",
        "Amount": 199,
        "Date": "7/5/18"
    },
    "Transaction_4": {
        "Name": "Printing solutions",
        "Location": "Afeka tel-aviv",
        "Amount": 16,
        "Date": "25/5/18"
    }
}

Summery

It’s all About this issue. Hope all solution helped you a lot. Comment below Your thoughts and your queries. Also, Comment below which solution worked for you? Thank You.

Also, Read