AttributeError: 'module' object has no attribute '__version__'
Asked Answered
B

2

1

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!

Barfield answered 23/7, 2016 at 0:58 Comment(3)
Do you have a module named lda.py or lda.pyc in the current directory?Greenling
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]Barfield
I've posted it as an answer.Greenling
G
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.

Greenling answered 23/7, 2016 at 1:59 Comment(1)
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)Barfield
B
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.

Buchholz answered 17/2, 2022 at 6:36 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.