AttributeError: 'module' object has no attribute 'xxx'

****************************

申明:本文所有內容僅供學習交流使用,歡迎留言提出寶貴建議。。。

*****************************

如標題所示:今天被這個問題折騰了好久,後面終於網上找到了原因是由於命名的問題,引用的模塊和程序模塊同名了,而程序在尋找方法屬性時被誤導爲程序本身,所有拋出了這個錯誤。

國外網站的解釋如下:


Look at the path in the traceback. It looks like you may be importing your own module called pycurl.py, not the actual pycurl library. Try renaming that file to something else so Python imports the real pycurl.


內容來源:http://www.tqzgc.com/articles/8.html

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章