Search code examples
python-3.xtranslatetextblob

textblob error 'list' object has no attribute 'strip'


1

I'm using TextBlob to translate some text , it worked fine till I tested it today ... I'm using python 3 textblob Version: 0.15.3. Is there a new update or something like that ?


Solution

  • Seems like it's been deprecated, and suggest using official Google Translate API:

    0.16.0 (2020-04-26) Deprecations:

    TextBlob.translate() and TextBlob.detect_language are deprecated. Use the official Google Translate API instead (#215). Other changes:

    Backwards-incompatible: Drop support for Python 3.4. Test against Python 3.7 and Python 3.8. Pin NLTK to nltk<3.5 on Python 2 (#315).

    you can find such warning in the new version of the library: '''Translate the word to another language using Google's Translate API.

        .. deprecated:: 0.16.0
            Use the official Google Translate API instead.
        .. versionadded:: 0.5.0
        '''
    

    it appears that google blocks a request and asks to solve captcha: https://github.com/sloria/TextBlob/issues/215