FileNotFoundError: [Errno 2] 没有这样的文件或目录:'/env/lib/python3.7/site-packages/googlesearch/browser_agents.txt'

问题描述

我在 gcloud 上部署我的代码,然后出现以下错误

File "/env/lib/python3.7/site-packages/googlesearch/googlesearch.py",line 20,in <module>
    class GoogleSearch:
File "/env/lib/python3.7/site-packages/googlesearch/googlesearch.py",line 21,in GoogleSearch
    with open(resource_filename('googlesearch','browser_agents.txt'),'r') as file_handle:
FileNotFoundError: [Errno 2] No such file or directory: '/env/lib/python3.7/site-packages/googlesearch/browser_agents.txt'
[2021-03-26 07:18:59 +0000] [8] [INFO] Worker exiting (pid: 8)
[2021-03-26 07:18:59 +0000] [1] [INFO] Shutting down: Master
[2021-03-26 07:18:59 +0000] [1] [INFO] Reason: Worker Failed to boot.

我在第 20 和 21 行的代码

from googlesearch.googlesearch import GoogleSearch
from bs4 import BeautifulSoup

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)