1
votes

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? - John Gordon
You gave me a good direction to find the issue... it is silly mistake of mine that i named my py file 'lda.py' so python got confused and didn't load the LDA library due to that! Thanks John [if you submit an answer i will vote for it] - Samer Aamar
I've posted it as an answer. - John Gordon

1 Answers

2
votes

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.