问题
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