Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 无法使用tweepy从twitter获取阿拉伯语数据?_Python_Python 3.x_Tweepy - Fatal编程技术网

Python 无法使用tweepy从twitter获取阿拉伯语数据?

Python 无法使用tweepy从twitter获取阿拉伯语数据?,python,python-3.x,tweepy,Python,Python 3.x,Tweepy,我正在尝试使用twitter获取数据 python上的tweepy库我遇到这个错误,我已经尝试了一些解决方案,比如更改键,但仍然不起作用 import tweepy import xlsxwriter from TweetClassifier import TweetClassifier from DataCleaner import DataCleaner import pandas as pd import os from tweepy import OAuthHandler class T

我正在尝试使用twitter获取数据 python上的tweepy库我遇到这个错误,我已经尝试了一些解决方案,比如更改键,但仍然不起作用

import tweepy
import xlsxwriter
from TweetClassifier import TweetClassifier
from DataCleaner import DataCleaner
import pandas as pd
import os
from tweepy import OAuthHandler
class TwitterAPI:

    tweets = None
    query = None
    number_of_tweets = 100
    date = None
    consumer_key = "vxxxxxxxxxxxxxxxx6"
    consumer_secret = "Exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxvv"
    access_token = "295xxx24-eYxxxxxxerE9"
    access_secret = "V2xxxxxxxxWadL"
    data_clean = DataCleaner()
    tweets_classifier = TweetClassifier()

    def __init__(self):

        return

    def Auth(self):

        auth = tweepy.OAuthHandler(self.consumer_key, self.consumer_secret)
        auth.set_access_token(self. access_token, self.access_secret)
        api = tweepy.API(auth)
        return api

        def retrieve_tweets(self, query, api):
            tweets = []
            for tweet in tweepy.Cursor(api.search, q=query).items(100):
                tweets.append(tweet.text)
            return tweets

您能将该错误粘贴到问题中吗?HTTP错误401-未经授权:由于凭据无效,访问被拒绝。所以这是一个登录问题。当您发布堆栈跟踪时,请包含全部内容,以便我们看到程序中哪一行失败。您可以将该错误粘贴到问题中吗?HTTP错误401-未经授权:由于凭据无效,访问被拒绝。所以这是一个登录问题。当你发布堆栈跟踪时,包括所有内容,这样我们就可以看到你的程序中哪一行失败了。