question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

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

See original GitHub issue

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'

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

3reactions
sdelgadoccommented, Dec 10, 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.

2reactions
AndChen153commented, 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!

Read more comments on GitHub >

github_iconTop Results From Across the Web

Tweepy Why did I receive AttributeError for search [closed]
Yes! search is not a valid attribute. According to the docs, you should use search_tweets . Docs are here.
Read more >
Tweepy AttributeError API object has no attribute search
How To Fix Tweepy AttributeError API object has no attribute search. Make sure you have latest version of tweepy installed. In [7]:. pip...
Read more >
Attributeerror: api object has no attribute search ( Fix It)
Attributeerror : api object has no attribute search error occurs because of the incompatibility of syntax with the current version(V4.x) of tweeps.
Read more >
Frequently Asked Questions — tweepy 4.12.1 documentation
If you're attempting to use API.me with Tweepy v4, you'll get an AttributeError about the API object not having a me attribute.
Read more >
tweepy.error.TweepError: [{'message': 'You currently have ...
I'm following a tutorial as I don't have much dev experience in python. ... when I try this I get - AttributeError: module...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found