module 'pickle' has no attribute 'dump'

后端 未结 2 1166
孤独总比滥情好
孤独总比滥情好 2021-02-19 21:40
import pickle

imelda = (\'More Mayhem\',
          \'IMelda May\',
          \'2011\',
          ((1, \'Pulling the Rug\'),
           (2, \'Psycho\'),
           (3, \         


        
相关标签:
2条回答
  • 2021-02-19 21:58

    You might have used your Python file name as pickle.py. Python interpreter is confused and looking for dump function in you file pickle.py instead of the package you have imported. Change the name of your file to something else, it will work.

    0 讨论(0)
  • 2021-02-19 22:11

    Happened to me too. I had a file called pickle.py in my current directory. Just rename it and it's fixed :)

    0 讨论(0)
提交回复
热议问题