I have a love-hate relationship with Pydev on Eclipse. For some reason it is now telling me that it has an unresolved import on the code:
import csv
Traceback (most recent call last):
File "/Users/peterstannett/Documents/Programming/python/eclipse/workspace/myFirstPydev/csv.py", line 1, in <module>
import csv
File "/Users/peterstannett/Documents/Programming/python/eclipse/workspace/myFirstPydev/csv.py", line 3, in <module>
cr = csv.reader(f)
AttributeError: 'module' object has no attribute 'reader'
It was working fine a few days ago I'm sure!
So I started to look at the interpreter and the path where the csv.py file should be and I can see in the System PYTHONPATH that it has the /lib/python2.7 where the csv.py file is held yet I still get an error.

Would someone please help me resolve this as it is most frustrating!
Thanks
Since your file is called csv.py, it is found before the csv module from the standard library when you import csv. Rename your file to something like myCsv.py to resolve the ambiguity.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With