Open mckinlec opened 11 months ago
Hi,
I had the same error while testing things out with chatdocs. This is coming from the change of import path of Embeddings in langchain in the latest version - 0.0.293.
Fix/pin langchain version to 0.0.292 in your environment, and you'll be good to go. This PR ( Fixed langchain version #81 ) is covering this.
I'm getting the following error even after running
conda install -c conda-forge langchain
chatdocs download ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /mnt/i/chatdocs/chatdocs/chatdocs/main.py:23 in download │ │ │ │ 20 │ │ 21 @app.command() │ │ 22 def download(config: ConfigPath = None): │ │ ❱ 23 │ from .download import download │ │ 24 │ │ │ 25 │ config = get_config(config) │ │ 26 │ download(config=config) │ │ │ │ ╭─── locals ────╮ │ │ │ config = None │ │ │ ╰───────────────╯ │ │ │ │ /mnt/i/chatdocs/chatdocs/chatdocs/download.py:3 in <module> │ │ │ │ 1 from typing import Any, Dict │ │ 2 │ │ ❱ 3 from .embeddings import get_embeddings │ │ 4 from .llms import get_llm │ │ 5 │ │ 6 │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ __builtins__ = { │ │ │ │ │ '__name__': 'builtins', │ │ │ │ │ '__doc__': 'Built-in functions, exceptions, and other │ │ │ │ objects.\n\nNoteworthy: None is the
nil'+46, │ │ │ │ │ 'package': '', │ │ │ │ │ 'loader': <class '_frozen_importlib.BuiltinImporter'>, │ │ │ │ │ 'spec': ModuleSpec(name='builtins', loader=<class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │ │ │ │ 'build_class': <built-in function build_class>, │ │ │ │ │ 'import':nil'+46, │ │ │ │ │ '__package__': '', │ │ │ │ │ '__loader__': <class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, │ │ │ │ │ '__spec__': ModuleSpec(name='builtins', loader=<class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │ │ │ │ '__build_class__': <built-in function __build_class__>, │ │ │ │ │ '__import__': <built-in function __import__>, │ │ │ │ │ 'abs': <built-in function abs>, │ │ │ │ │ 'all': <built-in function all>, │ │ │ │ │ 'any': <built-in function any>, │ │ │ │ │ ... +145 │ │ │ │ } │ │ │ │ __cached__ = '/mnt/i/chatdocs/chatdocs/chatdocs/__pycache__/embeddings.c… │ │ │ │ __doc__ = None │ │ │ │ __file__ = '/mnt/i/chatdocs/chatdocs/chatdocs/embeddings.py' │ │ │ │ __loader__ = <_frozen_importlib_external.SourceFileLoader object at │ │ │ │ 0x7f4b7646ae90> │ │ │ │ __name__ = 'chatdocs.embeddings' │ │ │ │ __package__ = 'chatdocs' │ │ │ │ __spec__ = ModuleSpec(name='chatdocs.embeddings', │ │ │ │ loader=<_frozen_importlib_external.SourceFileLoader object │ │ │ │ at 0x7f4b7646ae90>, │ │ │ │ origin='/mnt/i/chatdocs/chatdocs/chatdocs/embeddings.py') │ │ │ │ Any = typing.Any │ │ │ │ Dict = typing.Dict │ │ │ │ HuggingFaceEmbeddings = <class │ │ │ │ 'langchain.embeddings.huggingface.HuggingFaceEmbeddings'> │ │ │ │ HuggingFaceInstructEmbeddings = <class │ │ │ │ 'langchain.embeddings.huggingface.HuggingFaceInstructEmbedd… │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ModuleNotFoundError: No module named 'langchain.embeddings.base' (chatdocs) chris@CM-PC:/mnt/i/chatdocs/chatdocs$ cd chatdocs (chatdocs) chris@CM-PC:/mnt/i/chatdocs/chatdocs/chatdocs$ chatdocs download ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /mnt/i/chatdocs/chatdocs/chatdocs/main.py:23 in download │ │ │ │ 20 │ │ 21 @app.command() │ │ 22 def download(config: ConfigPath = None): │ │ ❱ 23 │ from .download import download │ │ 24 │ │ │ 25 │ config = get_config(config) │ │ 26 │ download(config=config) │ │ │ │ ╭─── locals ────╮ │ │ │ config = None │ │ │ ╰───────────────╯ │ │ │ │ /mnt/i/chatdocs/chatdocs/chatdocs/download.py:3 in <module> │ │ │ │ 1 from typing import Any, Dict │ │ 2 │ │ ❱ 3 from .embeddings import get_embeddings │ │ 4 from .llms import get_llm │ │ 5 │ │ 6 │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ __builtins__ = { │ │ │ │ │ '__name__': 'builtins', │ │ │ │ │ '__doc__': 'Built-in functions, exceptions, and other │ │ │ │ objects.\n\nNoteworthy: None is the
nil'+46, │ │ │ │ │ 'package': '', │ │ │ │ │ 'loader': <class '_frozen_importlib.BuiltinImporter'>, │ │ │ │ │ 'spec': ModuleSpec(name='builtins', loader=<class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │ │ │ │ 'build_class': <built-in function build_class>, │ │ │ │ │ 'import':nil'+46, │ │ │ │ │ '__package__': '', │ │ │ │ │ '__loader__': <class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, │ │ │ │ │ '__spec__': ModuleSpec(name='builtins', loader=<class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │ │ │ │ '__build_class__': <built-in function __build_class__>, │ │ │ │ │ '__import__': <built-in function __import__>, │ │ │ │ │ 'abs': <built-in function abs>, │ │ │ │ │ 'all': <built-in function all>, │ │ │ │ │ 'any': <built-in function any>, │ │ │ │ │ ... +145 │ │ │ │ } │ │ │ │ __cached__ = '/mnt/i/chatdocs/chatdocs/chatdocs/__pycache__/embeddings.c… │ │ │ │ __doc__ = None │ │ │ │ __file__ = '/mnt/i/chatdocs/chatdocs/chatdocs/embeddings.py' │ │ │ │ __loader__ = <_frozen_importlib_external.SourceFileLoader object at │ │ │ │ 0x7f2004faeec0> │ │ │ │ __name__ = 'chatdocs.embeddings' │ │ │ │ __package__ = 'chatdocs' │ │ │ │ __spec__ = ModuleSpec(name='chatdocs.embeddings', │ │ │ │ loader=<_frozen_importlib_external.SourceFileLoader object │ │ │ │ at 0x7f2004faeec0>, │ │ │ │ origin='/mnt/i/chatdocs/chatdocs/chatdocs/embeddings.py') │ │ │ │ Any = typing.Any │ │ │ │ Dict = typing.Dict │ │ │ │ HuggingFaceEmbeddings = <class │ │ │ │ 'langchain.embeddings.huggingface.HuggingFaceEmbeddings'> │ │ │ │ HuggingFaceInstructEmbeddings = <class │ │ │ │ 'langchain.embeddings.huggingface.HuggingFaceInstructEmbedd… │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ModuleNotFoundError: No module named 'langchain.embeddings.base' (chatdocs) chris@CM-PC:/mnt/i/chatdocs/chatdocs/chatdocs$ cd .. (chatdocs) chris@CM-PC:/mnt/i/chatdocs/chatdocs$ cd .. (chatdocs) chris@CM-PC:/mnt/i/chatdocs$ chatdocs download ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮ │ /mnt/i/chatdocs/chatdocs/chatdocs/main.py:23 in download │ │ │ │ 20 │ │ 21 @app.command() │ │ 22 def download(config: ConfigPath = None): │ │ ❱ 23 │ from .download import download │ │ 24 │ │ │ 25 │ config = get_config(config) │ │ 26 │ download(config=config) │ │ │ │ ╭─── locals ────╮ │ │ │ config = None │ │ │ ╰───────────────╯ │ │ │ │ /mnt/i/chatdocs/chatdocs/chatdocs/download.py:3 in <module> │ │ │ │ 1 from typing import Any, Dict │ │ 2 │ │ ❱ 3 from .embeddings import get_embeddings │ │ 4 from .llms import get_llm │ │ 5 │ │ 6 │ │ │ │ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │ │ │ __builtins__ = { │ │ │ │ │ '__name__': 'builtins', │ │ │ │ │ '__doc__': 'Built-in functions, exceptions, and other │ │ │ │ objects.\n\nNoteworthy: None is the
nil'+46, │ │ │ │ │ 'package': '', │ │ │ │ │ 'loader': <class '_frozen_importlib.BuiltinImporter'>, │ │ │ │ │ 'spec': ModuleSpec(name='builtins', loader=<class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │ │ │ │ 'build_class': <built-in function build_class>, │ │ │ │ │ 'import':nil'+46, │ │ │ │ │ '__package__': '', │ │ │ │ │ '__loader__': <class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, │ │ │ │ │ '__spec__': ModuleSpec(name='builtins', loader=<class │ │ │ │ '_frozen_importlib.BuiltinImporter'>, origin='built-in'), │ │ │ │ │ '__build_class__': <built-in function __build_class__>, │ │ │ │ │ '__import__': <built-in function __import__>, │ │ │ │ │ 'abs': <built-in function abs>, │ │ │ │ │ 'all': <built-in function all>, │ │ │ │ │ 'any': <built-in function any>, │ │ │ │ │ ... +145 │ │ │ │ } │ │ │ │ __cached__ = '/mnt/i/chatdocs/chatdocs/chatdocs/__pycache__/embeddings.c… │ │ │ │ __doc__ = None │ │ │ │ __file__ = '/mnt/i/chatdocs/chatdocs/chatdocs/embeddings.py' │ │ │ │ __loader__ = <_frozen_importlib_external.SourceFileLoader object at │ │ │ │ 0x7f94ec95ae60> │ │ │ │ __name__ = 'chatdocs.embeddings' │ │ │ │ __package__ = 'chatdocs' │ │ │ │ __spec__ = ModuleSpec(name='chatdocs.embeddings', │ │ │ │ loader=<_frozen_importlib_external.SourceFileLoader object │ │ │ │ at 0x7f94ec95ae60>, │ │ │ │ origin='/mnt/i/chatdocs/chatdocs/chatdocs/embeddings.py') │ │ │ │ Any = typing.Any │ │ │ │ Dict = typing.Dict │ │ │ │ HuggingFaceEmbeddings = <class │ │ │ │ 'langchain.embeddings.huggingface.HuggingFaceEmbeddings'> │ │ │ │ HuggingFaceInstructEmbeddings = <class │ │ │ │ 'langchain.embeddings.huggingface.HuggingFaceInstructEmbedd… │ │ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ModuleNotFoundError: No module named 'langchain.embeddings.base'