我曾经使用过GoogleTrans,但由于出现此错误而停止工作 AttributeError: 'NoneType' object has no attribute 'group' 然后我找到了这篇文章googletrans stopped working with error 'NoneType' object has no attribute 'group' 然后,我尝试通过运行pip install googletrans==3.1.0a0来使用该版本 然而,由于我使用的是Python2.7,它似乎不能工作。我正在为Ple
嗨,我只想把文本翻译成英语。我正在使用anaconda,它在cmd python foo.py上翻译,但它在anaconda设置上给出了错误。 from googletrans import Translator
translator=Translator()
translator.translate("jumps over") 上面写着 AttributeError: 'NoneType' object has no attribute 'group'
##EDIT
I tryed but same Error occured
from g
我正在运行以下代码:
from googletrans import Translator, constants
from pprint import print
# init the Google API translator
translator = Translator()
# translate a spanish text to english text (by default)
translation = translator.translate("Hola Mundo")
print("{} ({}) --> {} ({})".fo
我有波兰语的熊猫数据框专栏,想要翻译成英语,但我得到了错误。代码如下:
from googletrans import Translator
translator = Translator()
df['text_en'] = df2['text_pl'].apply(translator.translate, src='pl', dest='en')
以下错误:
63
64 # this will be the same as python code after stripping out a res
我正在尝试用python创建一个非常简单的翻译程序。但是我正在使用的库有错误。所以,我会把我的代码,和错误。帮助我解决它,或给我其他图书与简单的代码。我的代码:
from simple_googletrans import GoogleTrans
t = GoogleTrans()
t.translate('hello world', dest='ar')
错误:
Traceback (most recent call last):
File "transl2.py", line 3, in <module>
t = G
我正在尝试使用googletrans从英语翻译到波斯语。但它给了我这个错误
这是我的代码:
from googletrans import Translator
translator = Translator()
result = translator.translate('This is an egg', dest='fa')
我得到了以下错误:
---------------------------------------------------------------------------
AttributeError
我是Python的新手。我有一个问题,但我不知道如何解决它。
我的代码:
from googletrans import Translator
translator: Translator = Translator()
result ='''The core library includes the data types, variables and literals, etc.
The standard library includes the set of functions manipulating strings, files, etc.
The Stand
我正在尝试用python做一个使用googletrans的小图形翻译器。它运行正常,直到我按下翻译按钮,这是我得到的错误消息 Exception in Tkinter callback
Traceback (most recent call last):
File "C:\python\lib\tkinter\__init__.py", line 1884, in __call__
return self.func(*args)
File "C:\Users\lenue\OneDrive\Desktop\run.py", line 36, in run
tra
当尝试使用googletrans将英文文本翻译成印地语时,输出是印地语脚本。我能把剧本设置成英语吗?
例如
print(googletrans.Translator().translate('Tum kon ho?',src='hindi',dest='english').text)
以“您是谁”的形式返回输出。
但是,当我这样做的时候
print(googletrans.Translator().translate('Who are you?',src='english',dest='hindi'
我正在尝试导入一个googletrans,但是当我试图导入它时,我得到了一个ModuleNotFoundError,尽管我安装了它。
我犯了这个错误
11 #to translate the text data
12 get_ipython().system('pip install googletrans')
---> 13 from googletrans import Translator
ModuleNotFoundError: No module named 'googletrans'
我正在尝试在jupyter笔记本上安装一个带有所有语法的g
我正在编写代码来使用GUI制作一个翻译器。我的程序正在运行,但是当我试图翻译文本时,它会抛出错误AttributeError: 'NoneType' object has no attribute 'group'。
我的代码
from tkinter import*
from tkinter import ttk
from googletrans import Translator,LANGUAGES
def change(text="type",src="English",dest="Hindi"):
我正在尝试使用googletrans翻译一个yml文件。这是我的密码:
#Import
from googletrans import Translator
import re
# API
translator = Translator()
# Counter
counter_DoNotTranslate = 0
counter_Translate = 0
#Translater
with open("ValuesfileNotTranslatedTest.yml") as a_file: #Values file not translated
for object
正在尝试python中的以下正则表达式,但它返回一个错误
import re
...
#read a line from a file to variable line
# loking for the pattern 'WORD' in the line ...
m=re.search('(?<=[WORD])\w+',str(line))
m.group(0)
我得到以下错误:
AttributeError:'NoneType‘对象没有属性'group'