ModuleNotFoundError: No module named 'langchain'

128 Views Asked by At

i tried to extract data from an unstructured pdf file in python Vscode, i searched all solutions in google without any improvement,

i struggled with an error when i tried to import LangChain library, although the installation was done successfully, even i tried to change the python kernel version to 3.8 , 3.9 , 3.10 , and finally 3.11. also i tried to change the langchain version from the last one 0.1.7 to 0.130 and 0.150 but the same issue i found it, with notice that i created venv , please i need help ,((i installed all packages with pip and its done successfully))

pip install langchain
import sys
sys.path.append('C:\Program Files\requests-2.31.0')
sys.path.append('C:\Program Files\langchain_core-0.1.24')
sys.path.append('C:\Program Files\langchain-0.1.7')
sys.path.append('C:\Program Files\langchain_community-0.0.21')
sys.path.append('C:\Program Files\aiohttp-3.9.3')
from langchain.document_loaders.image import UnstructuredImageLoader

--
ModuleNotFoundError                       Traceback (most recent call last)
Cell In[9], line 1
----> 1 from langchain.document_loaders.image import UnstructuredImageLoader

File C:\Program Files\langchain-0.1.7\langchain\document_loaders\__init__.py:22
     18 from typing import Any
     20 from langchain_core._api import LangChainDeprecationWarning
---> 22 from langchain.utils.interactive_env import is_interactive_env
     24 # For backwards compatibility
     25 _old_to_new_name = {
     26     "PagedPDFSplitter": "PyPDFLoader",
     27     "TelegramChatLoader": "TelegramChatFileLoader",
     28 }

File C:\Program Files\langchain-0.1.7\langchain\utils\__init__.py:7
      1 """
      2 **Utility functions** for LangChain.
      3 
      4 These functions do not depend on any other LangChain module.
      5 """
----> 7 from langchain_core.utils.formatting import StrictFormatter, formatter
      8 from langchain_core.utils.input import (
      9     get_bolded_text,
     10     get_color_mapping,
...
     14     "LANGCHAIN_HUB_URL_BASE",
     15     "https://raw.githubusercontent.com/hwchase17/langchain-hub/{ref}/",
     16 )

ModuleNotFoundError: No module named 'requests'
Output is truncated. View as a scrollable element or open in a text editor. Adjust cell output settings...
0

There are 0 best solutions below