欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

出現(xiàn)module 'queue' has no attribute 'Queue'問題的解決

 更新時間:2023年04月28日 14:05:48   作者:chde2Wang  
這篇文章主要介紹了出現(xiàn)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程序時,也許會出現(xiàn)這樣的錯誤:

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

如:

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

1.手動安裝該模塊

2.檢查文件名

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

只需要更改文件名即可

總結

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

相關文章

最新評論