langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
51.64k stars 7.47k forks source link

ModuleNotFoundError: No module named 'markdown' #1815

Closed keyog0 closed 10 months ago

keyog0 commented 10 months ago

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

crazywoola commented 10 months ago

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
JohnJyong commented 10 months ago

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