[Bug] superset_config.py is not working as expecting.
Make sure these boxes are checked before submitting your issue - thank you!
- [x] I have checked the superset logs for python stacktraces and included it here as text if there are any.
- [x] I have reproduced the issue with at least the latest released version of superset.
- [x] I have checked the issue tracker for the same issue and I haven't found one similar.
Superset version
https://github.com/apache/incubator-superset/commit/fc8acf27c82ef3030d641289fa80f926f2a83b76
Expected results
working with settings from supset_config.py
Actual results
try:
if CONFIG_PATH_ENV_VAR in os.environ:
# Explicitly import config module that is not in pythonpath; useful
# for case where app is being executed via pex.
print('Loaded your LOCAL configuration at [{}]'.format(
os.environ[CONFIG_PATH_ENV_VAR]))
module = sys.modules[__name__]
override_conf = imp.load_source(
'superset_config',
os.environ[CONFIG_PATH_ENV_VAR])
for key in dir(override_conf):
if key.isupper():
setattr(module, key, getattr(override_conf, key))
else:
from superset_config import * # noqa
import superset_config
print('Loaded your LOCAL configuration at [{}]'.format(
superset_config.__file__))
except ImportError:
pass
there not CONFIG_PATH_ENV_VAR in os environment, and throw a exception when finding superset_config module "there is no superset_config module" .
Steps to reproduce
Create a virtual environemnt and activate it (recommended)
virtualenv -p python3 ./venv
setup a python3.6 virtualenv
source venv/bin/activate
Install external dependencies
pip install -r requirements.txt pip install -r requirements-dev.txt
Install Superset in editable (development) mode
pip install -e .
Create an admin user
fabmanager create-admin --app superset
Initialize the database
superset db upgrade
Create default roles and permissions
superset init
Load some data to play with
superset load_examples
Start the Flask dev web server from inside the superset dir (but see below for frontend asset compilation)
cd superset flask run -p 8080 --with-threads --reload --debugger
If you fire up a python shell from that context and import superset_config, does it work?
If you fire up a python shell from that context and
import superset_config, does it work?
I have pycharm and suspend at that point, then run import superset_config , and got error could not find module superset_config
please check you SUPERSET_HOME env setting
On Mon, Dec 10, 2018 at 11:48 AM 达斯特兰斯 [email protected] wrote:
If you fire up a python shell from that context and import superset_config, does it work?
I have pycharm and suspend at that point, then run import superset_config , and got error could not find module superset_config
— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-superset/issues/6499#issuecomment-445660618, or mute the thread https://github.com/notifications/unsubscribe-auth/AB7FUqhNMcT5EVG2eRoGUO8-DW1oEyxMks5u3dmEgaJpZM4ZHs9g .
please check you SUPERSET_HOME env setting …
Is there any document in the tutorial says how to set SUPERSET_HOME ?
SUPERSET_HOME
just add export SUPERSET_HOME="path to config" to your .bashrc or your .bash_profile in your home. Then restart your terminal.
If superset_home doesn't work change it with export PYTHONPATH="path to config:$PYTHONPATH"
export PYTHONPATH=/opt/superset
replase the path /opt/superset with path where your superset_config in
Anyone think we need to clarify the docs here http://superset.apache.org/installation.html#configuration ? It's clear enough to me, but maybe that's mostly because I probably wrote the docs on this....
@kk580kk
export SUPERSET_HOME=<superset home directory>
export SUPERSET_CONFIG_PATH=<overwrite default superset_config.py>
@mistercrunch make sure it is in your PYTHONPATH
I got it, but it is not a naturally expection as I had followed the tutorial but got a error. Maybe I need to read some more document before trying to run this project.
@zhaoyongjie Thanks,