最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Deepl API key python Authorization Failure - Stack Overflow

programmeradmin5浏览0评论

I'm trying to run a script in python for a little project that requires also translation and I've my API key from DeepL API defined

DEEPL_API_KEYS = ['example987654321:fx']

Everything on the script is working fine without DeepL but we really need to get the translations in. The problem is that due to my noobness I can't seem to make heads or tails of the following Authorization failure:

 Traceback (most recent call last):
Traceback (most recent call last):
 File "/Users/.../sample.py", line x, in <module>
    main()
  File "/Users/.../sample.py", line x, in main
    translated_body = translate_text(body)
  
File "/Users/.../sample.py", line x, in translate_text
    result = translator.translate_text(text, target_lang=target_lang, formality=formality)
    
File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/deepl/translator.py", line 455, in translate_text
        self._raise_for_status(status, content, json)
    File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/deepl/translator.py", line 184, in _raise_for_status
        raise AuthorizationException(
    deepl.exceptions.AuthorizationException: Authorization failure, check auth_key
发布评论

评论列表(0)

  1. 暂无评论