亚洲乱码中文字幕综合,中国熟女仑乱hd,亚洲精品乱拍国产一区二区三区,一本大道卡一卡二卡三乱码全集资源,又粗又黄又硬又爽的免费视频

出現module 'queue' has no attribute 'Queue'問題的解決

 更新時間:2023年04月28日 14:05:48   作者:chde2Wang  
這篇文章主要介紹了出現module 'queue' has no attribute 'Queue'問題的解決方案,具有很好的參考價值,希望對大家有所幫助。如有錯誤或未考慮完全的地方,望不吝賜教

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了 

python:AttributeError: module 'xxx' has no attribute 'xxx'的錯誤

運行python程序時,也許會出現這樣的錯誤:

AttributeError: module ‘xxx’ has no attribute ‘xxx’

如:

在我的學習中,解決該錯誤有兩種方法

1.手動安裝該模塊

2.檢查文件名

這個方式看起來很傻,但是卻是新手經常會犯的錯,原因是因為自己的文件名稱和要使用的模塊重名了:

只需要更改文件名即可

總結

以上為個人經驗,希望能給大家一個參考,也希望大家多多支持腳本之家。

相關文章

最新評論