1. 程式人生 > >出現AttributeError: module 'selenium.webdriver' has no attribute 'Firefox'的時候解決辦法

出現AttributeError: module 'selenium.webdriver' has no attribute 'Firefox'的時候解決辦法

當執行所有的程式時候都會出錯,而且錯誤碼一樣:

>>> browser = webdriver.Firefox(firefox_binary=binary)
>>> AttributeError: module 'selenium.webdriver' has no attribute 'Firefox' 

百思不得其解時候,網上的一句話提醒了我:

It looks like you're caught in a circular import loop. Rename your local email.py file to something else, aslib/http/client.py
is importing it instead of the real systememail module.
– John GordonNov 11 '16 at 19:34

程式陷入了一個死迴圈。

所以這個時候能做的就是修改錯誤程式的名稱,比如:

rename 檔案  email.py為email16.py

再次執行的時候,就會正常!

有興趣的可以加一下python愛好者的QQ群:812113097

這裡有很多像你一樣的夥伴,共同分享學習python的經驗!