AttributeError:“模块"对象没有属性"__version__" [英] AttributeError: 'module' object has no attribute '__version__'

查看:251
本文介绍了AttributeError:“模块"对象没有属性"__version__"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经安装了LDA图书馆(使用pip) 我有一个非常简单的测试代码(接下来的两行)

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

导入lda

import lda

打印lda.datasets.load_reuters()

print lda.datasets.load_reuters()

但是我不断收到错误

AttributeError:模块"对象没有属性数据集"

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

实际上,我每次访问lda下的任何属性/功能时都会得到提示!

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

推荐答案

当前目录中是否有名为lda.pylda.pyc的模块?

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

如果是这样,则您的import语句正在查找该模块,而不是真正的" lda模块.

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

这篇关于AttributeError:“模块"对象没有属性"__version__"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆