求助11月15号课程上的实例在windows上运行Langchain_RAGProject-main时报错ImportError: failed to find libmagic. Check your installation #386
Labels
No Label
bug
duplicate
enhancement
help wanted
invalid
question
wontfix
No Milestone
No project
No Assignees
3 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: HswOAuth/llm_course#386
Loading…
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Traceback (most recent call last):
File "C:\Python310\lib\site-packages\gradio\queueing.py", line 624, in process_events
response = await route_utils.call_process_api(
File "C:\Python310\lib\site-packages\gradio\route_utils.py", line 323, in call_process_api
output = await app.get_blocks().process_api(
File "C:\Python310\lib\site-packages\gradio\blocks.py", line 2018, in process_api
result = await self.call_function(
File "C:\Python310\lib\site-packages\gradio\blocks.py", line 1567, in call_function
prediction = await anyio.to_thread.run_sync( # type: ignore
File "C:\Python310\lib\site-packages\anyio\to_thread.py", line 56, in run_sync
return await get_async_backend().run_sync_in_worker_thread(
File "C:\Python310\lib\site-packages\anyio_backends_asyncio.py", line 2357, in run_sync_in_worker_thread
return await future
File "C:\Python310\lib\site-packages\anyio_backends_asyncio.py", line 864, in run
result = context.run(func, *args)
File "C:\Python310\lib\site-packages\gradio\utils.py", line 846, in wrapper
response = f(*args, **kwargs)
File "d:\文件\唐总发的关于AI学习视频\20241115\Langchain_RAGProject-main\Langchain_RAGProject-main\src\Knowledge.py", line 55, in upload_knowledge
self.create_indexes(collection_name, file_path)
File "d:\文件\唐总发的关于AI学习视频\20241115\Langchain_RAGProject-main\Langchain_RAGProject-main\src\Knowledge.py", line 94, in create_indexes
loader = DocumentChunker(file_path)
File "d:\文件\唐总发的关于AI学习视频\20241115\Langchain_RAGProject-main\Langchain_RAGProject-main\src\DocumentChunker.py", line 31, in init
self.file_type_ = detect_filetype(file_path)
File "C:\Python310\lib\site-packages\unstructured\file_utils\filetype.py", line 98, in detect_filetype
return _FileTypeDetector.file_type(ctx)
File "C:\Python310\lib\site-packages\unstructured\file_utils\filetype.py", line 131, in file_type
return cls(ctx)._file_type
File "C:\Python310\lib\site-packages\unstructured\file_utils\filetype.py", line 141, in _file_type
if file_type := self._file_type_from_guessed_mime_type:
File "C:\Python310\lib\site-packages\unstructured\file_utils\filetype.py", line 181, in _file_type_from_guessed_mime_type
mime_type = self._ctx.mime_type
File "C:\Python310\lib\site-packages\unstructured\utils.py", line 154, in get
value = self.fget(obj)
File "C:\Python310\lib\site-packages\unstructured\file_utils\filetype.py", line 362, in mime_type
import magic
File "C:\Python310\lib\site-packages\magic_init.py", line 209, in
libmagic = loader.load_lib()
File "C:\Python310\lib\site-packages\magic\loader.py", line 49, in load_lib
raise ImportError('failed to find libmagic. Check your installation')
ImportError: failed to find libmagic. Check your installation
pip uninstall python-magic
pip install python-magic-bin==0.4.14
pip install python-magic-bin==0.4.14,在autodl执行报错,python3.10、3.11均报错