gpt4 book ai didi

python - 无法在python中导入模块

转载 作者:行者123 更新时间:2023-12-05 00:49:14 24 4
gpt4 key购买 nike

我不得不安装模块“google”,然后由于错误,在阅读了 SO 答案后,我不得不手动卸载它。从那以后,我无法导入 bs4。它总是给我以下错误:

Error processing line 3 of /usr/local/lib/python3.6/dist-packages/googleapis_common_protos-1.5.3-nspkg.pth:

Traceback (most recent call last):
File "/usr/lib/python3.6/site.py", line 174, in addpackage
exec(line)
File "<string>", line 1, in <module>
File "<frozen importlib._bootstrap>", line 568, in module_from_spec
AttributeError: 'NoneType' object has no attribute 'loader'

Remainder of file ignored

我在 ubuntu 17.10 中使用 Python 3。

最佳答案

我的观点是您的软件包 unistall 没有正确完成,并且该 google 软件包中的某些内容已被遗忘。

在您的位置,我会尝试移动此文件: googleapis_common_protos-1.5.3-nspkg.pth (暂时将其放在其他地方)然后查看您的导入模块是否有效,在这种情况下删除该文件。

关于python - 无法在python中导入模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48025409/

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