美文网首页
pycharm googletrans AttributeErr

pycharm googletrans AttributeErr

作者: Maj_sunshine | 来源:发表于2020-12-14 20:02 被阅读0次

记录一个谷歌翻译的解决方案, 之前的python翻译插件googletrans, 最近不能使用了。

百度都是这个答案

pip uninstall googletrans
git clone https://github.com/BoseCorp/py-googletrans.git
cd ./py-googletrans && python setup.py install

然而这个我这里是无效的。

在百度里面倒腾很久,发现根本没有有效的解决方案. 后在stackoverflow 上找到答案

结论

使用 google_trans_new 来解决问题。

可以

pip install google_trans_new

然后在工程中使用。

或者
下载google_trans_new 文件直接导入pycharm 工程中, 在翻译脚本的同一级目录
然后使用

from google_trans_new import google_translator。 

相关文章

网友评论

      本文标题:pycharm googletrans AttributeErr

      本文链接:https://www.haomeiwen.com/subject/yxrbgktx.html