蟒蛇Twitter的API()未找到错误 [英] python twitter Api() not found error

查看:138
本文介绍了蟒蛇Twitter的API()未找到错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图使用Python,Twitter的模块,但仍然有问题发起twitter.Api()。我已经检查和复查名为twitter.py或twitter.pyc没有其他文件是我的系统上。在一个干净的安装我第一次尝试

I'm trying to use the python-twitter module, but still having problems initiating the twitter.Api(). I've checked and rechecked that no other file named twitter.py or twitter.pyc is on my system. On a clean install i first try to

>>> import twitter 

和得到正确的响应未知模块中的

and correctly get a response of 'module unknown'

我做了 easy_install的微博,全成。

然后做

>>> import twitter
>>> testapi = twitter.Api()

的响应

Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    testapi = twitter.Api()
AttributeError: 'module' object has no attribute 'Api'
>>> 

我太累了试图在这里找到问题,请帮助。

I'm exhausted trying to locate the problem here, please help.

推荐答案

看来,你试图遵循一个Python的微博模块的文档,当你在使用另一个Python模块Twitter的事实。

It appears that you are trying to follow the documentation for one Python Twitter module when you are in fact using another Python Twitter module.

API()方法调用你提到的的这条巨蟒的Twitter模块。但是,当您使用 easy_install的微博,你实际上得到这个其他的Python的Twitter模块

The Api() method call you mention is part of this Python Twitter module. However, when you use easy_install twitter, you actually get this other Python Twitter module.

这篇关于蟒蛇Twitter的API()未找到错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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