devcontainer error using Docker Dev Environments - Dify Backend API #555

Closed
opened 2026-02-21 17:27:34 -05:00 by yindo · 0 comments
Owner

Originally created by @jf-xia on GitHub (Oct 5, 2023).

Dify version

main

Cloud or Self Hosted

Self Hosted

Steps to reproduce

devcontainer error using Docker Dev Environments - Dify Backend API:

  1. Start backend:
    flask run --host 0.0.0.0 --port=5001 --debug
    

Reason:
old version watchdog in /opt/conda/lib/python3.11/site-packages (2.1.6)


Need to do:
pip install --upgrade watchdog

✔️ Expected Behavior

vscode ➜ /workspaces/dify/api (main) $ flask run --host 0.0.0.0 --port=5001 --debug
/opt/conda/lib/python3.11/site-packages/feedparser/encodings.py:29: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
import cgi

  • Debug mode: on
    INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:5001
  • Running on http://172.17.0.2:5001
    INFO:werkzeug:Press CTRL+C to quit
    INFO:werkzeug: * Restarting with watchdog (inotify)
    /opt/conda/lib/python3.11/site-packages/feedparser/encodings.py:29: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
    import cgi
    WARNING:werkzeug: * Debugger is active!
    INFO:werkzeug: * Debugger PIN: 128-417-477

Actual Behavior

vscode ➜ /workspaces/dify/api (main) $ flask run --host 0.0.0.0 --port=5001 --debug
/opt/conda/lib/python3.11/site-packages/feedparser/encodings.py:29: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13
import cgi

  • Debug mode: on
    INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
  • Running on all addresses (0.0.0.0)
  • Running on http://127.0.0.1:5001
  • Running on http://172.17.0.2:5001
    INFO:werkzeug:Press CTRL+C to quit
    Traceback (most recent call last):
    File "/opt/conda/bin/flask", line 8, in
    sys.exit(main())
    ^^^^^^
    File "/opt/conda/lib/python3.11/site-packages/flask/cli.py", line 1064, in main
    cli.main()
    File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
    ^^^^^^^^^^^^^^^^
    File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/conda/lib/python3.11/site-packages/click/decorators.py", line 92, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/conda/lib/python3.11/site-packages/flask/cli.py", line 924, in run_command
    run_simple(
    File "/opt/conda/lib/python3.11/site-packages/werkzeug/serving.py", line 1097, in run_simple
    run_with_reloader(
    File "/opt/conda/lib/python3.11/site-packages/werkzeug/_reloader.py", line 440, in run_with_reloader
    reloader = reloader_loops[reloader_type](
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    File "/opt/conda/lib/python3.11/site-packages/werkzeug/_reloader.py", line 315, in init
    from watchdog.events import EVENT_TYPE_OPENED
    ImportError: cannot import name 'EVENT_TYPE_OPENED' from 'watchdog.events' (/opt/conda/lib/python3.11/site-packages/watchdog/events.py)
Originally created by @jf-xia on GitHub (Oct 5, 2023). ### Dify version main ### Cloud or Self Hosted Self Hosted ### Steps to reproduce devcontainer error using Docker Dev Environments - Dify Backend API: 6. Start backend: ```bash flask run --host 0.0.0.0 --port=5001 --debug ``` ------------ Reason: old version watchdog in /opt/conda/lib/python3.11/site-packages (2.1.6) ------------ Need to do: pip install --upgrade watchdog ### ✔️ Expected Behavior vscode ➜ /workspaces/dify/api (main) $ flask run --host 0.0.0.0 --port=5001 --debug /opt/conda/lib/python3.11/site-packages/feedparser/encodings.py:29: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 import cgi * Debug mode: on INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on all addresses (0.0.0.0) * Running on http://127.0.0.1:5001 * Running on http://172.17.0.2:5001 INFO:werkzeug:Press CTRL+C to quit INFO:werkzeug: * Restarting with watchdog (inotify) /opt/conda/lib/python3.11/site-packages/feedparser/encodings.py:29: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 import cgi WARNING:werkzeug: * Debugger is active! INFO:werkzeug: * Debugger PIN: 128-417-477 ### ❌ Actual Behavior vscode ➜ /workspaces/dify/api (main) $ flask run --host 0.0.0.0 --port=5001 --debug /opt/conda/lib/python3.11/site-packages/feedparser/encodings.py:29: DeprecationWarning: 'cgi' is deprecated and slated for removal in Python 3.13 import cgi * Debug mode: on INFO:werkzeug:WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead. * Running on all addresses (0.0.0.0) * Running on http://127.0.0.1:5001 * Running on http://172.17.0.2:5001 INFO:werkzeug:Press CTRL+C to quit Traceback (most recent call last): File "/opt/conda/bin/flask", line 8, in <module> sys.exit(main()) ^^^^^^ File "/opt/conda/lib/python3.11/site-packages/flask/cli.py", line 1064, in main cli.main() File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1078, in main rv = self.invoke(ctx) ^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1688, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 1434, in invoke return ctx.invoke(self.callback, **ctx.params) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/decorators.py", line 92, in new_func return ctx.invoke(f, obj, *args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/click/core.py", line 783, in invoke return __callback(*args, **kwargs) ^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/flask/cli.py", line 924, in run_command run_simple( File "/opt/conda/lib/python3.11/site-packages/werkzeug/serving.py", line 1097, in run_simple run_with_reloader( File "/opt/conda/lib/python3.11/site-packages/werkzeug/_reloader.py", line 440, in run_with_reloader reloader = reloader_loops[reloader_type]( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/opt/conda/lib/python3.11/site-packages/werkzeug/_reloader.py", line 315, in __init__ from watchdog.events import EVENT_TYPE_OPENED ImportError: cannot import name 'EVENT_TYPE_OPENED' from 'watchdog.events' (/opt/conda/lib/python3.11/site-packages/watchdog/events.py)
yindo added the 🐞 bug label 2026-02-21 17:27:34 -05:00
yindo closed this issue 2026-02-21 17:27:34 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#555