I was following a tutorial on langchain, and after using loader.load() to load a PDF file, it gave me an error and suggested that some dependencies are missing and I should install them using pip install unstructured[local-inference]
. So, I did. But it is now installing a whole lot of packages. A whole lot of it includes some packages to do with nvidia-*
. Can someone please explain what this command does? It took a good couple of hours for this command to complete.

- 1,216
- 3
- 12
- 27
-
1How much detail do you want "explain what this command does"? It's installing the third party library [`unstructured`](https://pypi.org/project/unstructured/). See how to create a [mcve], and [edit] the question. – Peter Wood Apr 04 '23 at 09:55
-
2Which parts do you understand? Do you know what `pip` is? What `install` does? Do you know the difference between `unstructured[local-inference]` and `unstructured`? Critically, which of these are you actually asking about? – MisterMiyagi Apr 22 '23 at 10:15
4 Answers
When you run "pip install unstructured," you simply install the "unstructured" package; no other dependencies are installed.
On the other hand, if you use the command "pip install unstructured[local-inference]", you additionally install the "local-inference" package as a dependency in addition to the "unstructured" package.
In situations when you must make predictions on data that is kept locally on your system, the "local-inference" package offers a collection of tools and utilities for doing local inference with machine learning models.
Additionally, as stated in the documentation, you may use pip install unstructured if you do not need to handle PDFs or pictures
-
Can you explain what "local-inference" typically does in the application? Or what operations that packages through `pip install unstructured` can't do? – chen Apr 30 '23 at 22:09
It's the command that installs 'unstructured(https://pypi.org/project/unstructured/)' package. It's for pre-processing text documents such as PDFs, HTML and Word Documents. So, it might be big and have many dependancies since it processes several types of documents.

- 181
- 11
the right method is:pip install "unstructured[local-inference]"

- 1
-
As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers [in the help center](/help/how-to-answer). – Community Apr 24 '23 at 22:40
I installed unstructured already but I still had the same problem.
it seems like the correct way to do it is to do
pip install "unstructured[local-inference]"
instead of
pip install unstructured
here's the documentation that I got this info from: unstructured

- 11
- 1