I just have a newly created Environment in Anaconda (conda 22.9.0 and Python 3.10.10). Then I proceed to install langchain (pip install langchain
if I try conda install langchain it does not work). According to the quickstart guide I have to install one model provider so I install openai (pip install openai
).
Then I enter to the python console and try to load a PDF using the class UnstructuredPDFLoader and I get the following error. What the problem could be?
(langchain) C:\Users\user>python
Python 3.10.10 | packaged by Anaconda, Inc. | (main, Mar 21 2023, 18:39:17) [MSC v.1916 64 bit (AMD64)] on win32
>>> from langchain.document_loaders import UnstructuredPDFLoader
>>> loader = UnstructuredPDFLoader("C:\\<path-to-data>\\data\\name-of-file.pdf")
Traceback (most recent call last):
File "C:\<path-to-anaconda>\envs\langchain\lib\site-packages\langchain\document_loaders\unstructured.py", line 32, in __init__
import unstructured # noqa:F401
ModuleNotFoundError: No module named 'unstructured'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\<path-to-anaconda>\envs\langchain\lib\site-packages\langchain\document_loaders\unstructured.py", line 90, in __init__
super().__init__(mode=mode, **unstructured_kwargs)
File "C:\<path-to-anaconda>\envs\langchain\lib\site-packages\langchain\document_loaders\unstructured.py", line 34, in __init__
raise ValueError(
ValueError: unstructured package not found, please install it with `pip install unstructured`