langchain
langchain copied to clipboard
ValueError: Invalid file union\Book1.csv. The FileType.UNK file type is not supported in partition.
Hi, I am using DirectoryLoader as document loader and for some of csv files getting below error
ValueError: Invalid file union\Book1.csv. The FileType.UNK file type is not supported in partition.
can anyone suggest oplease, how to fix this, I will be thankful to you.
Thank You
seems to be similar to this one: https://github.com/imClumsyPanda/langchain-ChatGLM/issues/46
Thanks dsx1986
I think my virtual environment was not created successfully that's why I was getting this error. After creating again the new fresh environment with updated packages then this issue has been fixed.
Thanks
LangChain uses unstructured to determine the file types.
There is a dependency on libmagic
to be installed in the system for unstructured
to work correctly:
https://github.com/Unstructured-IO/unstructured/blob/3c3c59a726582cbf1d1bd5bbfe5ad015d4a3c1f6/unstructured/file_utils/filetype.py#L187-L195
In Debian you would need the packages libmagic-mgc
and libmagic1
to have this working correctly.