ModuleNotFoundError: No module named 'markdown' #825

Closed
opened 2026-02-21 17:28:36 -05:00 by yindo · 2 comments
Owner

Originally created by @keyog0 on GitHub (Dec 21, 2023).

Originally assigned to: @JohnJyong on GitHub.

Self Checks

Dify version

0.3.34

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

  File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request
    return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args)
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 467, in wrapper
    resp = resource(*args, **kwargs)
  File "/usr/local/lib/python3.10/site-packages/flask/views.py", line 109, in view
    return current_app.ensure_sync(self.dispatch_request)(**kwargs)
  File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 582, in dispatch_request
    resp = meth(*args, **kwargs)
  File "/app/api/controllers/console/setup.py", line 79, in decorated
    return view(*args, **kwargs)
  File "/app/api/libs/login.py", line 94, in decorated_view
    return current_app.ensure_sync(func)(*args, **kwargs)
  File "/app/api/controllers/console/wraps.py", line 20, in decorated
    return view(*args, **kwargs)
  File "/app/api/controllers/console/datasets/datasets.py", line 269, in post
    response = indexing_runner.file_indexing_estimate(current_user.current_tenant_id, file_details,
  File "/app/api/core/indexing_runner.py", line 236, in file_indexing_estimate
    text_docs = FileExtractor.load(file_detail)
  File "/app/api/core/data_loader/file_extractor.py", line 37, in load
    return cls.load_from_file(file_path, return_text, upload_file, is_automatic)
  File "/app/api/core/data_loader/file_extractor.py", line 105, in load_from_file
    return delimiter.join([document.page_content for document in loader.load()]) if return_text else loader.load()
  File "/app/api/core/data_loader/loader/unstructured/unstructured_markdown.py", line 38, in load
    from unstructured.partition.md import partition_md
  File "/usr/local/lib/python3.10/site-packages/unstructured/partition/md.py", line 3, in <module>
    import markdown
ModuleNotFoundError: No module named 'markdown'

✔️ Expected Behavior

I looked at the "change log 0.3.34" and opened and linked "Unstructured" correctly, but the error occurred.

Actual Behavior

I added a markdown file to "create knowledge", but there is an issue that the module cannot be imported from the API server.
The image I used is langgenius/dify-api:0.3.34

Originally created by @keyog0 on GitHub (Dec 21, 2023). Originally assigned to: @JohnJyong on GitHub. ### Self Checks - [X] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [X] I confirm that I am using English to file this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). ### Dify version 0.3.34 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce ``` File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1469, in dispatch_request return self.ensure_sync(self.view_functions[rule.endpoint])(**view_args) File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 467, in wrapper resp = resource(*args, **kwargs) File "/usr/local/lib/python3.10/site-packages/flask/views.py", line 109, in view return current_app.ensure_sync(self.dispatch_request)(**kwargs) File "/usr/local/lib/python3.10/site-packages/flask_restful/__init__.py", line 582, in dispatch_request resp = meth(*args, **kwargs) File "/app/api/controllers/console/setup.py", line 79, in decorated return view(*args, **kwargs) File "/app/api/libs/login.py", line 94, in decorated_view return current_app.ensure_sync(func)(*args, **kwargs) File "/app/api/controllers/console/wraps.py", line 20, in decorated return view(*args, **kwargs) File "/app/api/controllers/console/datasets/datasets.py", line 269, in post response = indexing_runner.file_indexing_estimate(current_user.current_tenant_id, file_details, File "/app/api/core/indexing_runner.py", line 236, in file_indexing_estimate text_docs = FileExtractor.load(file_detail) File "/app/api/core/data_loader/file_extractor.py", line 37, in load return cls.load_from_file(file_path, return_text, upload_file, is_automatic) File "/app/api/core/data_loader/file_extractor.py", line 105, in load_from_file return delimiter.join([document.page_content for document in loader.load()]) if return_text else loader.load() File "/app/api/core/data_loader/loader/unstructured/unstructured_markdown.py", line 38, in load from unstructured.partition.md import partition_md File "/usr/local/lib/python3.10/site-packages/unstructured/partition/md.py", line 3, in <module> import markdown ModuleNotFoundError: No module named 'markdown' ``` ### ✔️ Expected Behavior I looked at the "change log 0.3.34" and opened and linked "Unstructured" correctly, but the error occurred. ### ❌ Actual Behavior I added a markdown file to "create knowledge", but there is an issue that the module cannot be imported from the API server. The image I used is `langgenius/dify-api:0.3.34`
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 17:28:36 -05:00
yindo closed this issue 2026-02-21 17:28:36 -05:00
Author
Owner

@crazywoola commented on GitHub (Dec 22, 2023):

I have clone the project again and cleanup the data. And use a fresh new copy to start the application by docker. Looks good to me.

[+] Running 56/7
 ✔ weaviate 4 layers [⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                          58.7s 
 ✔ db 9 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                           17.7s 
 ✔ web 10 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                        66.0s 
 ✔ nginx 7 layers [⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                          22.0s 
 ✔ api Pulled                                                                                                                                                                                               59.8s 
 ✔ worker 12 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                   59.8s 
 ✔ redis 7 layers [⣿⣿⣿⣿⣿⣿⣿]      0B/0B      Pulled                                                                                                                                                          55.8s 
[+] Building 0.0s (0/0)                                                                                                                                                                      docker:desktop-linux
[+] Running 8/8
 ✔ Network docker_default       Created                                                                                                                                                                      0.0s 
 ✔ Container docker-weaviate-1  Created                                                                                                                                                                      0.0s 
 ✔ Container docker-db-1        Created                                                                                                                                                                      0.0s 
 ✔ Container docker-web-1       Created                                                                                                                                                                      0.0s 
 ✔ Container docker-redis-1     Created                                                                                                                                                                      0.0s 
 ✔ Container docker-worker-1    Created                                                                                                                                                                      0.1s 
 ✔ Container docker-api-1       Created                                                                                                                                                                      0.1s 
 ✔ Container docker-nginx-1     Created                                                                                                                                                                      0.0s 
Attaching to docker-api-1, docker-db-1, docker-nginx-1, docker-redis-1, docker-weaviate-1, docker-web-1, docker-worker-1
@crazywoola commented on GitHub (Dec 22, 2023): I have clone the project again and cleanup the data. And use a fresh new copy to start the application by docker. Looks good to me. ``` [+] Running 56/7 ✔ weaviate 4 layers [⣿⣿⣿⣿] 0B/0B Pulled 58.7s ✔ db 9 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 17.7s ✔ web 10 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 66.0s ✔ nginx 7 layers [⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 22.0s ✔ api Pulled 59.8s ✔ worker 12 layers [⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 59.8s ✔ redis 7 layers [⣿⣿⣿⣿⣿⣿⣿] 0B/0B Pulled 55.8s [+] Building 0.0s (0/0) docker:desktop-linux [+] Running 8/8 ✔ Network docker_default Created 0.0s ✔ Container docker-weaviate-1 Created 0.0s ✔ Container docker-db-1 Created 0.0s ✔ Container docker-web-1 Created 0.0s ✔ Container docker-redis-1 Created 0.0s ✔ Container docker-worker-1 Created 0.1s ✔ Container docker-api-1 Created 0.1s ✔ Container docker-nginx-1 Created 0.0s Attaching to docker-api-1, docker-db-1, docker-nginx-1, docker-redis-1, docker-weaviate-1, docker-web-1, docker-worker-1 ```
Author
Owner

@JohnJyong commented on GitHub (Jan 5, 2024):

the issue has fixed at this pr :https://github.com/langgenius/dify/pull/1821
pls use the latest tag ,thanks

@JohnJyong commented on GitHub (Jan 5, 2024): the issue has fixed at this pr :https://github.com/langgenius/dify/pull/1821 pls use the latest tag ,thanks
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#825