Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: 'API' object has no attribute 'search_full_archive' #1462

Closed
ajc356 opened this issue Dec 1, 2020 · 5 comments
Closed

AttributeError: 'API' object has no attribute 'search_full_archive' #1462

ajc356 opened this issue Dec 1, 2020 · 5 comments
Labels
Invalid This is not valid Question This is a question

Comments

@ajc356
Copy link

ajc356 commented Dec 1, 2020

I'm having problems accessing historical content using both of the new search_full_archive and search_30_day features. I've updated tweepy to Version: 3.9.0, yet still when I try to run either api.search_full_archive or api.search_30_day I get AttributeError: 'API' object has no attribute 'search_full_archive'... however when I do the equivalent search using regular api.search I get results as expected.

I will note that I am using the free sandbox versions and do have different environment names for my 30-days sandbox and my full-history sandbox.

Any thoughts?


api = tweepy.API(auth, parser=tweepy.parsers.JSONParser(), wait_on_rate_limit=True, wait_on_rate_limit_notify=True)

test = api.search_30_day(environment_name='30daycerb', q = '#cerb')

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-73-0b2b236c134b> in <module>
----> 1 test = api.search_30_day(environment_name='30daycerb',
      2                                             q = '#cerb')

AttributeError: 'API' object has no attribute 'search_30_day'

my_new_tweets = api.search_full_archive(environment_name='cerbhistory', query='#CERB')

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-74-c8e25af8d1ef> in <module>
----> 1 my_new_tweets = api.search_full_archive(environment_name='cerbhistory', query='#CERB')

AttributeError: 'API' object has no attribute 'search_full_archive'
@sdelgadoc
Copy link

For some reason, the latest tweepy package doesn't ship with the latest version of the api.py file, which includes the search_30_day, and search_full_archive methods.

However, the latest version of the code on GitHub does include these methods.

To solve your issue try uninstalling tweepy:

pip uninstall tweepy

and then install it directly from GitHub:

pip install git+https://github.com/tweepy/tweepy.git

This fixed the issue for me, and I hope it does for you too.

@AndChen153
Copy link

AndChen153 commented Dec 12, 2020

For some reason, the latest tweepy package doesn't ship with the latest version of the api.py file, which includes the search_30_day, and search_full_archive methods.

However, the latest version of the code on GitHub does include these methods.

To solve your issue try uninstalling tweepy:

pip uninstall tweepy

and then install it directly from GitHub:

pip install git+https://github.com/tweepy/tweepy.git

This fixed the issue for me, and I hope it does for you too.

I had the same issue with the search methods and this solved it for me too. thanks for the help!

@Harmon758
Copy link
Member

API.search_full_archive and API.search_30_day are currently only in the development version on the master branch.
In the future, please make sure you're using the latest development version when reporting issues.

See the installation instructions in the documentation for how to install from the repository.

To solve your issue try uninstalling tweepy:

pip uninstall tweepy

and then install it directly from GitHub:

pip install git+https://github.com/tweepy/tweepy.git

Uninstalling to reinstall shouldn't be necessary; using the --upgrade flag should work fine.

@Harmon758 Harmon758 added Invalid This is not valid Question This is a question labels Dec 15, 2020
@Venkatakrishnan-Ramesh

This comment has been minimized.

@Harmon758

This comment has been minimized.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Invalid This is not valid Question This is a question
Projects
None yet
Development

No branches or pull requests

5 participants