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

旧巷老猫 提交于 2019-12-11 05:54:02

问题


I have installed LDA plibrary (using pip) I have a very simple test code (the next two rows)

import lda

print lda.datasets.load_reuters()

But i keep getting the error

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

in fact i get that each time i access any attribute/function under lda!


回答1:


Do you have a module named lda.py or lda.pyc in the current directory?

If so, then your import statement is finding that module instead of the "real" lda module.



来源:https://stackoverflow.com/questions/38537125/attributeerror-module-object-has-no-attribute-version

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!