Following is my code,
import shelve
sd = shelve.open("session.data")
When I try the same code in IDLE , I am not getting any error. But when running the script with this code, I am getting the following error,
Traceback (most recent call last):
File "try.py", line 3, in <module>
sd = shelve.open("session.data")
AttributeError: 'module' object has no attribute 'open'
You imported a different module
shelve
, one that masks the standard library version.Do:
and move that file aside, rename it, or delete it.