when run 'flask db upgrade', but get an error: ModuleNotFoundError: No module named 'gevent' #1871

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

Originally created by @chenj-freedom on GitHub (Apr 8, 2024).

Self Checks

  • This is only for bug report, if you would like to ask a quesion, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • Pleas do not modify this template :) and fill in all the required fields.

Dify version

main

Cloud or Self Hosted

Self Hosted (Source)

Steps to reproduce

flask db upgrade

  • Tip: There are .env or .flaskenv files present. Do "pip install python-dotenv" to use them.
    Error: While importing 'app', an ImportError was raised:

Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 219, in locate_app
import(module_name)
File "/Users/andrew.chen/Documents/workspaces/others/dify/api/app.py", line 6, in
from gevent import monkey
ModuleNotFoundError: No module named 'gevent'

I have installed gevent as follows:

pip list | grep gevent
gevent 23.9.1

And I directly executed 'import gevent' in the Python interactive command line without any error. However, I'm not sure why executing 'flask db upgrade' is causing an error.

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @chenj-freedom on GitHub (Apr 8, 2024). ### Self Checks - [X] This is only for bug report, if you would like to ask a quesion, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [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 submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [X] Pleas do not modify this template :) and fill in all the required fields. ### Dify version main ### Cloud or Self Hosted Self Hosted (Source) ### Steps to reproduce > flask db upgrade * Tip: There are .env or .flaskenv files present. Do "pip install python-dotenv" to use them. Error: While importing 'app', an ImportError was raised: Traceback (most recent call last): File "/usr/local/lib/python3.11/site-packages/flask/cli.py", line 219, in locate_app __import__(module_name) File "/Users/andrew.chen/Documents/workspaces/others/dify/api/app.py", line 6, in <module> from gevent import monkey ModuleNotFoundError: No module named 'gevent' I have installed gevent as follows: > pip list | grep gevent gevent 23.9.1 And I directly executed 'import gevent' in the Python interactive command line without any error. However, I'm not sure why executing 'flask db upgrade' is causing an error. ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug🤔 cant-reproduce labels 2026-02-21 17:38:56 -05:00
yindo closed this issue 2026-02-21 17:38:56 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#1871