new commit on superset_config.py trys to import superset.typing but module not found
Environment
OS: Fedora 31 superset: Superset 0.35.2 node: v12.14.1 npm: 6.13.4 python: Python 3.7.6
Reproduce
- conda create env
- conda activate env
- pip install --upgrade setuptools pip
- pip install apache-superset
- I delete ~/.superset/superset.db
- add superset_config.py file to ~/.superset/
- edit SQLALCHEMY connection string to connect to mysql db
- superset db upgrade
- flask fab create-admin
- fill out info
Expected results
- Admin user successfully created
Actual results
ERROR:root:Found but failed to import local superset_config
Traceback (most recent call last):
File "/home/###/.conda/envs/superset/lib/python3.7/site-packages/superset/config.py", line 701, in
Error: While importing "superset", an ImportError was raised:
Traceback (most recent call last):
File "/home/###/.conda/envs/superset/lib/python3.7/site-packages/flask/cli.py", line 240, in locate_app
import(module_name)
File "/home/###/.conda/envs/superset/lib/python3.7/site-packages/superset/init.py", line 34, in
Additional Comments
I am putting superset_config.py in ~/.superset. Is that wrong? Its seems to be reading config file from conda sitepackages instead. In the docs you say to make sure this config file is in your Python Path. What does that mean?
OK I worked things out but I think the Documentation for Installation should be update I will submit pull request soon.
- Basically I want to show the user how to add path/to/virtual-env/lib/python3.7/site-packages/superset/ to their PYTHON Path
- This will be helpful because that's where the actual config.py that is used by "superset db upgrade" lives. And that just isnt clear right now by the documentation
I did docker-compose -f docker-compose-non-dev.yml pull docker-compose -f docker-compose-non-dev.yml up
now I have started seeing error : superset_init | ModuleNotFoundError: No module named 'superset.typing'
One possible solution.
You can copy the file superset/superset_typing.py to superset/typing.py. The last version(1.5.0) needs this fix. One or more files needs import the typing.py but the real name is superset_typing.py
@villebro This is an issue in the upgrade from 1.4.0 to 1.5.0 also. As suggested bt @amarolx I did copy the file superset_typing.py to typing.py and it went through
@Mabloq @amarolx @srinisubramanian did you try running with TAG as instructed in the docs? https://superset.apache.org/docs/installation/installing-superset-using-docker-compose#3-launch-superset-through-docker-compose
Specifically this part:

I am not using docker but a native pip install. I upgraded from 1.4.0 to 1.5.0 and had the issue. For another instance I use docker and did not have this issue there when I upgraded.
I had this also on upgrading to 1.5.0. I had some customisation in config.py (or values.yaml):
from superset.typing
needed to be changed to:
from superset.superset_typing
This is because the file has been renamed.
@phildum Thanks for pointing it out .. I also had some customization that was importing it. Not a superset issue but more the customization at my end.