I get the error:
AttributeError: 'module' object has no attribute 'reader')
when I run the code below but I can't see why?
import csv
with open('test.csv') as f:
q = csv.reader(f)
I get the error:
AttributeError: 'module' object has no attribute 'reader')
when I run the code below but I can't see why?
import csv
with open('test.csv') as f:
q = csv.reader(f)
You imported a different csv
module, not the one in the standard library. Perhaps you named your own script csv.py
for example.
Find out what is imported instead by printing out the filename of the module:
import csv
print(csv.__file__)
If that's not in the standard library, rename or delete this file, and remove the csv.pyc
file if there is one next to it.