3

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 ?

3 Answers3

9

I suggest that you explicitly specify the input language

blob = TextBlob("hello")
blob.translate(from_lang='en', to='fr')

Here is the output

TextBlob("bonjour")
Keliggg
  • 111
  • 1
  • 3
0

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

Vova
  • 3,117
  • 2
  • 15
  • 23
0

referred by https://github.com/sloria/TextBlob/issues/371

The issue has been fixed.