superset: ModuleNotFoundError: No module named 'werkzeug.wrappers.etag'
ModuleNotFoundError: No module named ‘werkzeug.wrappers.etag’ #20723
How to reproduce the bug
Install using pip on Ubuntu with python 3.9
Get to this point as per instructions:
$HOME/venv/superset/2.0.0/bin/superset db upgrade
Expected results
No error
Actual results
logging was configured successfully
2022-07-15 15:10:24,707:INFO:superset.utils.logging_configurator:logging was configured successfully
2022-07-15 15:10:24,713:INFO:root:Configured event logger of type <class 'superset.utils.log.DBEventLogger'>
Falling back to the built-in cache, that stores data in the metadata database, for the following cache: `FILTER_STATE_CACHE_CONFIG`. It is recommended to use `RedisCache`, `MemcachedCache` or another dedicated caching backend for production deployments
2022-07-15 15:10:24,716:WARNING:superset.utils.cache_manager:Falling back to the built-in cache, that stores data in the metadata database, for the following cache: `FILTER_STATE_CACHE_CONFIG`. It is recommended to use `RedisCache`, `MemcachedCache` or another dedicated caching backend for production deployments
Falling back to the built-in cache, that stores data in the metadata database, for the following cache: `EXPLORE_FORM_DATA_CACHE_CONFIG`. It is recommended to use `RedisCache`, `MemcachedCache` or another dedicated caching backend for production deployments
2022-07-15 15:10:24,720:WARNING:superset.utils.cache_manager:Falling back to the built-in cache, that stores data in the metadata database, for the following cache: `EXPLORE_FORM_DATA_CACHE_CONFIG`. It is recommended to use `RedisCache`, `MemcachedCache` or another dedicated caching backend for production deployments
Failed to create app
Traceback (most recent call last):
File "$HOME/venv/superset/2.0.0/lib/python3.9/site-packages/superset/app.py", line 37, in create_app
app_initializer.init_app()
File "$HOME/venv/superset/2.0.0/lib/python3.9/site-packages/superset/initialization/__init__.py", line 460, in init_app
self.init_app_in_ctx()
File "$HOME/venv/superset/2.0.0/lib/python3.9/site-packages/superset/initialization/__init__.py", line 409, in init_app_in_ctx
self.configure_url_map_converters()
File "$HOME/venv/superset/2.0.0/lib/python3.9/site-packages/superset/initialization/__init__.py", line 508, in configure_url_map_converters
from superset.utils.url_map_converters import (
File "$HOME/venv/superset/2.0.0/lib/python3.9/site-packages/superset/utils/url_map_converters.py", line 21, in <module>
from superset.models.tags import ObjectTypes
File "$HOME/venv/superset/2.0.0/lib/python3.9/site-packages/superset/models/__init__.py", line 17, in <module>
from . import core, datasource_access_request, dynamic_plugins, sql_lab, user_attributes
File "$HOME/venv/superset/2.0.0/lib/python3.9/site-packages/superset/models/core.py", line 63, in <module>
from superset.utils import cache as cache_util, core as utils
File "$HOME/venv/superset/2.0.0/lib/python3.9/site-packages/superset/utils/cache.py", line 28, in <module>
from werkzeug.wrappers.etag import ETagResponseMixin
ModuleNotFoundError: No module named 'werkzeug.wrappers.etag'
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 27 (7 by maintainers)
A hack to get around it:
If there’s one thing you can reply on with a superset release is dodgy pip deps.
@dpgaspar thanks a lot for pointing that out!
Was facing the same problem. Running 1.5.0, upgrading to 2.0.0.
My solution was:
This
requirements/base.txtassumes a development environment (considering the-e file:.in there), and that was causing conflicts with my installation setup.tailin my command is to skip those lines.After that I could move forward with applying db migrations successfully 😃
Hi @EMCP , i finally managed to run it.
this is whats was needed (hopefully). installed and uninstalled a dozen of packages, but these might be the relevant ones.
I made a variant of the command @WesleyBatista made, since the one he shared creates a file which isn’t necessary:
Seems like
ETagResponseMixinwas removed here: https://github.com/pallets/werkzeug/pull/2276 it was deprecated, we should update ouretag_cachemethod accordingly.Do note that production Superset installations should use pinned dependencies based on: https://github.com/apache/superset/blob/master/requirements/base.txt
@dat-linux I installed Flask == 2.1.0
Fixed as per the above commit.
I’m just the Ubuntu messenger. I cannot speak for Mac.
I recommend trying to install on a fresh Ubuntu 22.04 using pip install and you’ll see the problems. It comes with python 3.10, and this results in a failure based on a couple of problematic deps (see below).
Even when I install python 3.9 alongside, I get the error described above.
In order to overcome ALL issues I encountered I need to perform:
pip install apache-supersetusing the 3.9 binary) And immediately after that:The above needs to be done before the
superset db upgradestep.Just reporting as I see it based on a fresh install of Ubuntu 22.04 (with all system updates applied). Issues re markupsafe, and 3.10 failure (it results in an error when building the pyarrow pkg) have been reported elsewhere on this message board.
@trimat1 , I couldn’t get 22.04 to work whatsoever… python 3.10 has some breaking changes in the dependencies superset uses…
I backed down to 20.04 and did this routine to get setup, remove the
sudo -u ubuntu… I use Juju and that runs as Root by default which I do not want for SupersetWell, the original issue was found due to an attempt to install Superset on Ubuntu 22.04.
Install still fails on platforms that have Python 3.10 by default (ie Ubuntu 22.04).
can confirm it is indeed happening inside my LXC 20.04 container
python is 3.8.10 with latest pip