gpt4 book ai didi

python - ModuleNotFoundError : No module named 'googletrans'

转载 作者:行者123 更新时间:2023-12-03 08:40:07 24 4
gpt4 key购买 nike

代码(来自 googletrans import Translator)出现以下错误:

Traceback (most recent call last): File
"/Users/cadeylange/Documents/python_work/Personal/frequently_used_words.py",
line 2, in <module>
from googletrans import Translator ModuleNotFoundError: No module named 'googletrans' [Finished in 0.3s with exit code 1] [cmd:
['/usr/local/bin/python3', '-u',
'/Users/cadeylange/Documents/python_work/Personal/frequently_used_words.py']]
[dir: /Users/cadeylange/Documents/python_work/Personal] [path:
/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.8/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin]



我已经仔细检查了 googletrans 是否已使用 pip 成功安装,并且已经成功安装。我想不出为什么代码不起作用,我尝试使用不同的表达式导入它,包括基本的“import googletrans”语句。任何人都可以看到问题吗?

最佳答案

阅读回溯显示,您正在 Linux 机器上运行 Python 3,对吗?您是否尝试过使用 pip3 安装模块,什么应该使它可用于 Python 3。

关于python - ModuleNotFoundError : No module named 'googletrans' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/62425250/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com