【问题标题】:Issue with OAuthhandler with Tweepy in Python在 Python 中使用 Tweepy 的 OAuthhandler 问题
【发布时间】:2021-12-31 04:25:02
【问题描述】:
import tweepy as tw
from tweepy.auth import OAuthHandler

# your Twitter API key and API secret
my_api_key = "*****"
my_api_secret = "*****"

# authenticate
auth = tw.OAuthHandler(my_api_key, my_api_secret)

第 2 行出错 - 如果我保留这一行,它会给出 ImportError: No module named auth
错误 - AttributeError: 'module' object has no attribute 'OAuthHandler'(不使用第 2 行)

请帮忙!这一定很简单,但不起作用!

【问题讨论】:

标签: python tweepy twitterapi-python


【解决方案1】:

确保您的路径中没有其他名为 tweepy 的文件或文件夹。
您可能导入了 Tweepy 库以外的模块。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-04-12
    • 2017-06-14
    • 1970-01-01
    • 2017-10-13
    • 1970-01-01
    • 1970-01-01
    • 2022-10-18
    • 2011-07-06
    相关资源
    最近更新 更多