Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]python 3.10.8使用DuckDuckGoSearchRun模块报异常 #291

Closed
fish2018 opened this issue Apr 7, 2024 · 2 comments
Closed

[BUG]python 3.10.8使用DuckDuckGoSearchRun模块报异常 #291

fish2018 opened this issue Apr 7, 2024 · 2 comments
Assignees
Labels
bug Something isn't working

Comments

@fish2018
Copy link

fish2018 commented Apr 7, 2024

python 3.10.8使用DuckDuckGoSearchRun模块

from langchain_community.tools import DuckDuckGoSearchRun
web_search = DuckDuckGoSearchRun()

Traceback (most recent call last):
  File "/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/langchain_community/utilities/duckduckgo_search.py", line 33, in validate_environment
    from duckduckgo_search import DDGS  # noqa: F401
  File "/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/duckduckgo_search/__init__.py", line 10, in <module>
    from .duckduckgo_search import DDGS
  File "/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/duckduckgo_search/duckduckgo_search.py", line 7, in <module>
    from .duckduckgo_search_async import AsyncDDGS
  File "/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/duckduckgo_search/duckduckgo_search_async.py", line 13, in <module>
    from curl_cffi import requests
  File "/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/curl_cffi/__init__.py", line 18, in <module>
    from ._wrapper import ffi, lib  # type: ignore
ImportError: dlopen(/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/curl_cffi/_wrapper.abi3.so, 2): Library not loaded: @loader_path/.dylibs/libcurl-impersonate-chrome.4.dylib
  Referenced from: /Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/curl_cffi/_wrapper.abi3.so
  Reason: no suitable image found.  Did find:
	/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/curl_cffi/.dylibs/libcurl-impersonate-chrome.4.dylib: cannot load 'libcurl-impersonate-chrome.4.dylib' (load command 0x80000034 is unknown)
	/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/curl_cffi/.dylibs/libcurl-impersonate-chrome.4.dylib: cannot load 'libcurl-impersonate-chrome.4.dylib' (load command 0x80000034 is unknown)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/macbookpro/Desktop/chatdesk/enhance.py", line 86, in <module>
    web_search = DuckDuckGoSearchRun()
  File "/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/langchain_core/load/serializable.py", line 120, in __init__
    super().__init__(**kwargs)
  File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic/main.py", line 1066, in pydantic.main.validate_model
  File "pydantic/fields.py", line 439, in pydantic.fields.ModelField.get_default
  File "pydantic/main.py", line 339, in pydantic.main.BaseModel.__init__
  File "pydantic/main.py", line 1102, in pydantic.main.validate_model
  File "/Users/macbookpro/Desktop/chatdesk/env/lib/python3.10/site-packages/langchain_community/utilities/duckduckgo_search.py", line 35, in validate_environment
    raise ImportError(
ImportError: Could not import duckduckgo-search python package. Please install it with `pip install -U duckduckgo-search`.
@fish2018 fish2018 added the bug Something isn't working label Apr 7, 2024
@perklet
Copy link
Collaborator

perklet commented Apr 7, 2024

Older versions of macOS are not supported, please use a recent one. See lexiforest/curl-impersonate#53 for updates on the fix.

升级下 macOS 版本吧,老版本不支持。

@deedy5
Copy link
Contributor

deedy5 commented Apr 7, 2024

ImportError: Could not import duckduckgo-search python package. Please install it with pip install -U duckduckgo-search.

Install pip install -U duckduckgo_search

@perklet perklet closed this as not planned Won't fix, can't repro, duplicate, stale Apr 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants