首頁 後端開發 Python教學 以下是一些符合文章內容的英文問題標題: * Why is my \'googletrans\' package throwing a \'NoneType\' object has no attribute \'group\' error? * How to fix the \'NoneType\' object 有 no attribute \'group\' error in \'goo

以下是一些符合文章內容的英文問題標題: * Why is my \'googletrans\' package throwing a \'NoneType\' object has no attribute \'group\' error? * How to fix the \'NoneType\' object 有 no attribute \'group\' error in \'goo

Oct 29, 2024 am 07:50 AM

以下是一些符合文章内容的英文问题标题:

* Why is my 'googletrans' package throwing a 'NoneType' object has no attribute 'group' error?
* How to fix the 'NoneType' object has no attribute 'group' error in 'googletrans'?
* What are the solutions for the 'googletr

“googletrans”包不起作用:“NoneType”對像沒有屬性“group”

問題:

嘗試使用「googletrans」套件的使用者遇到了「NoneType」物件沒有屬性「group」的錯誤。

解決方案:

Alpha 版本更新(06.12.20)

  • 使用下列指令安裝「googletrans」的官方Alpha 版本:

    pip install googletrans==3.1.0a0
    登入後複製
  • 如果alpha 版本不起作用,請指定翻譯服務網址:

    <code class="python">from googletrans import Translator
    translator = Translator(service_urls=['translate.googleapis.com'])
    translator.translate("Der Himmel ist blau und ich mag Bananen", dest='en')</code>
    登入後複製

更新10.12.20

  • 使用下列指令安裝另一個修正程式:

    pip install googletrans==4.0.0-rc1
    登入後複製

替代選項:google_trans_new

  • 如果上述修復無法解決問題,請考慮使用「google_trans_new」替代套件:
    <code class="python">#pip install google_trans_new
    
    from google_trans_new import google_translator  
    translator = google_translator()  
    translate_text = translator.translate('สวัสดีจีน',lang_tgt='en')  
    print(translate_text)</code>
    登入後複製

以上是以下是一些符合文章內容的英文問題標題: * Why is my \'googletrans\' package throwing a \'NoneType\' object has no attribute \'group\' error? * How to fix the \'NoneType\' object 有 no attribute \'group\' error in \'goo的詳細內容。更多資訊請關注PHP中文網其他相關文章!

本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

熱門文章

倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章

倉庫:如何復興隊友
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
Hello Kitty Island冒險:如何獲得巨型種子
3 週前 By 尊渡假赌尊渡假赌尊渡假赌
R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
1 週前 By 尊渡假赌尊渡假赌尊渡假赌

熱門文章標籤

記事本++7.3.1

記事本++7.3.1

好用且免費的程式碼編輯器

SublimeText3漢化版

SublimeText3漢化版

中文版,非常好用

禪工作室 13.0.1

禪工作室 13.0.1

強大的PHP整合開發環境

Dreamweaver CS6

Dreamweaver CS6

視覺化網頁開發工具

SublimeText3 Mac版

SublimeText3 Mac版

神級程式碼編輯軟體(SublimeText3)

我如何使用美麗的湯來解析HTML? 我如何使用美麗的湯來解析HTML? Mar 10, 2025 pm 06:54 PM

我如何使用美麗的湯來解析HTML?

python中的圖像過濾 python中的圖像過濾 Mar 03, 2025 am 09:44 AM

python中的圖像過濾

如何在Python中下載文件 如何在Python中下載文件 Mar 01, 2025 am 10:03 AM

如何在Python中下載文件

如何使用Python查找文本文件的ZIPF分佈 如何使用Python查找文本文件的ZIPF分佈 Mar 05, 2025 am 09:58 AM

如何使用Python查找文本文件的ZIPF分佈

如何使用Python使用PDF文檔 如何使用Python使用PDF文檔 Mar 02, 2025 am 09:54 AM

如何使用Python使用PDF文檔

如何在django應用程序中使用redis緩存 如何在django應用程序中使用redis緩存 Mar 02, 2025 am 10:10 AM

如何在django應用程序中使用redis緩存

如何使用TensorFlow或Pytorch進行深度學習? 如何使用TensorFlow或Pytorch進行深度學習? Mar 10, 2025 pm 06:52 PM

如何使用TensorFlow或Pytorch進行深度學習?

引入自然語言工具包(NLTK) 引入自然語言工具包(NLTK) Mar 01, 2025 am 10:05 AM

引入自然語言工具包(NLTK)

See all articles