I am trying to read a json file in python but unable to do it. My json file is 436mb in size and I am using python 3.3.4 version Tried different ways
import json
from pprint import pprint
with open('drug-event-0002-of-0002.json') as data_file:
data = json.load(data_file)
print(data)
Error :
Traceback (most recent call last):
File "C:/Users/533335/Desktop/jsonReadTest.py", line 6, in <module>
print(data)
File "C:\Python33\lib\idlelib\PyShell.py", line 1339, in write
return self.shell.write(s, self.tags)
MemoryError
---------------------------------------------------------------------
import ijson
with open('drug-event-0002-of-0002.json', 'r') as f:
parser = ijson.parse(f)
for prefix, event, value in parser:
if prefix == "name":
print(value)
Error :
Traceback (most recent call last):
File "C:/Users/533335/Desktop/jsonReadTest.py", line 1, in <module>
import ijson
ImportError: No module named 'ijson'