• 聪少 Jeff
    2025-04-07 来自广东
    老师,按您的代码运行,出现了以下错误: python 1\ search.py Traceback (most recent call last): File "/Users/huangjiancong/Library/Mobile Documents/com~apple~CloudDocs/代码库/deepseek-11/test/1 search.py", line 4, in <module> results = search.run("What is the weather in New York?") ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Caskroom/miniconda/base/envs/deepseek/lib/python3.11/site-packages/langchain_core/tools/base.py", line 775, in run raise error_to_raise File "/opt/homebrew/Caskroom/miniconda/base/envs/deepseek/lib/python3.11/site-packages/langchain_core/tools/base.py", line 744, in run response = context.run(self._run, *tool_args, **tool_kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Caskroom/miniconda/base/envs/deepseek/lib/python3.11/site-packages/langchain_community/tools/ddg_search/tool.py", line 74, in _run return self.api_wrapper.run(query) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Caskroom/miniconda/base/envs/deepseek/lib/python3.11/site-packages/langchain_community/utilities/duckduckgo_search.py", line 114, in run results = self._ddgs_text(query) ^^^^^^^^^^^^^^^^^^^^^^ File "/opt/homebrew/Caskroom/miniconda/base/envs/deepseek/lib/python3.11/site-packages/langchain_community/utilities/duckduckgo_search.py", line 64, in _ddgs_text ddgs_gen = ddgs.text( ^^^^^^^^^^ File "/opt/homebrew/Caskroom/miniconda/base/envs/deepseek/lib/python3.11/site-packages/duckduckgo_search/duckduckgo_search.py", line 319, in text raise DuckDuckGoSearchException(err) duckduckgo_search.exceptions.DuckDuckGoSearchException: https://html.duckduckgo.com/html RuntimeError: error sending request for url (https://html.duckduckgo.com/html): operation timed out Caused by: operation timed out 是否需要科学上网才能正常使用“duckduckgo-search”和“langchain-community”两个库呢?
    展开
    
    