出错代码
from langchain_community.document_loaders import DirectoryLoader
loader = DirectoryLoader(DATA_PATH, glob="**/*.md")
documents = loader.load()
报错:ImportError: failed to find libmagic. Check your installation
解决方案
pip install python-magic-bin
接着出现了新的错误如下
ImportError: partition_md() is not available because one or more dependencies are not installed. Use: pip install "unstructured[md]" (including quotes) to install the required dependencies
解决方案:
pip install "unstructured[md]"
然后就成功运行了
1394






