简体   繁体   English

NameError:名称“ Klout”未定义

[英]NameError: name 'Klout' is not defined

I am facing a weird error in python klout API. 我在python klout API中遇到一个奇怪的错误。 I have installed klout module with pip install. 我已经使用pip install安装了klout模块。 I have created a api key and I use the following code: 我创建了一个api密钥,并使用以下代码:

from klout import *
 k = Klout('key')

My code was running normally until before 5 minutes whereI received: 我的代码一直正常运行,直到收到以下内容的5分钟之前:

 k = Klout('key')
 NameError: name 'Klout' is not defined

Any idea about this error? 对这个错误有任何想法吗? Is there any call limit per hour?? 每小时有通话限制吗?

You probably added a file klout.py in your path somewhere, masking the library you actually wanted to import. 您可能在路径中的某处添加了文件klout.py ,从而掩盖了您实际导入的库。

You can diagnose what file that is by printing the __file__ attribute on the Cuckoo module: 您可以通过在Cuckoo模块上打印__file__属性来诊断什么文件:

import klout
print(klout.__file__)

Rename that file; 重命名该文件; you don't want to mask your library. 您不想掩盖您的图书馆。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM