2

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!

3
  • 3
    Do you have a module named lda.py or lda.pyc in the current directory? Commented Jul 23, 2016 at 1:04
  • 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] Commented Jul 23, 2016 at 1:56
  • I've posted it as an answer. Commented Jul 23, 2016 at 2:00

2 Answers 2

2

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.

Sign up to request clarification or add additional context in comments.

1 Comment

my own mistake was that i named my python program with same name 'lda.py' which confused the python ! in order to fix i just renamed my own program (and delete lda.pyc as well)
0

I meet the some error in mmcv library and solve it with

pip install --upgrade packaging

here is reference link, hope this could help you.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.