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

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

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

module 'queue' has no attribute 'Queue'

import queue
q = queue.Queue()
q.put('a')
q.put('b')
print(q.get())
錯(cuò)誤:
AttributeError: module 'queue' has no attribute 'Queue'

解決方法 

把程序名命名和包名一樣導(dǎo)致錯(cuò)誤。命名為queue1.py就ok了 

python:AttributeError: module 'xxx' has no attribute 'xxx'的錯(cuò)誤

運(yùn)行python程序時(shí),也許會(huì)出現(xiàn)這樣的錯(cuò)誤:

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

如:

在我的學(xué)習(xí)中,解決該錯(cuò)誤有兩種方法

1.手動(dòng)安裝該模塊

2.檢查文件名

這個(gè)方式看起來很傻,但是卻是新手經(jīng)常會(huì)犯的錯(cuò),原因是因?yàn)樽约旱奈募Q和要使用的模塊重名了:

只需要更改文件名即可

總結(jié)

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

相關(guān)文章

最新評(píng)論