module 'queue' has no attribute 'Queue'解决

import queue
q = queue.Queue()
q.put('a')
q.put('b')
print(q.get())

错误:
AttributeError: module 'queue' has no attribute 'Queue'

解决方法: 

把程序名命名和包名一样导致错误。命名为queue1.py就ok了 

猜你喜欢

转载自blog.csdn.net/weixin_38383877/article/details/83150314