执行superset db upgrade报错:ModuleNotFoundError: No module named 'werkzeug.wrappers.etag'

我的Python版本是:3.9【一路升级上来的,py3.7、py3.8都试过了】
数据源SQL server【接下来会分享连接SQL server遇到的大坑】

在进行初始化Supetset数据库:superset db upgrade命令时报错:ModuleNotFoundError: No module named 'werkzeug.wrappers.etag'


ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
flask 2.2.2 requires Werkzeug>=2.2.2, but you have werkzeug 0.16.1 which is incompatible.
flask-login 0.6.2 requires Werkzeug>=1.0.1, but you have werkzeug 0.16.1 which is incompatible.
Successfully installed Werkzeug-0.16.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io
(base) [root@lxttest miniconda3]# pip install Werkzeug==1.0.1
Collecting Werkzeug==1.0.1
  Downloading Werkzeug-1.0.1-py2.py3-none-any.whl (298 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 298.6/298.6 kB 137.0 kB/s eta 0:00:00
Installing collected packages: Werkzeug
  Attempting uninstall: Werkzeug
    Found existing installation: Werkzeug 0.16.1
    Uninstalling Werkzeug-0.16.1:
      Successfully uninstalled Werkzeug-0.16.1
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
flask 2.2.2 requires Werkzeug>=2.2.2, but you have werkzeug 1.0.1 which is incompatible.
Successfully installed Werkzeug-1.0.1
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io
(base) [root@lxttest miniconda3]# pip install Werkzeug==2.2.2

看:flask 2.2.2 requires Werkzeug>=2.2.2, but you have werkzeug 0.16.1 which is incompatible.

可当你执行了: pip install Werkzeug==2.2.2
错误依旧存在:

解决办法:一定要先统一Flask和Werkzeug框架的版本,不然问题还是无法解决。

pip uninstall Flask
pip uninstall Werkzeug

pip install Flask==2.0.2
pip install Werkzeug==2.0.2

可以参考一下这个博主的博客,虽说没能解决我的问题,但还是很值得借鉴:https://www.csdn.net/tags/MtjaAg5sMDk5NzItYmxvZwO0O0OO0O0O.html

posted @ 2022-08-12 09:26  Leo-Wong  阅读(2356)  评论(0编辑  收藏  举报