Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'superset.cli'; 'superset' is not a package flask fab create-admin #7942

Closed
harish345 opened this issue Jul 29, 2019 · 8 comments
Labels
!deprecated-label:bug Deprecated label - Use #bug instead inactive Inactive for >= 30 days

Comments

@harish345
Copy link

Hi team,
Am trying to setup apache superset in windows 10.
But am unable to create admin used using flask fab create-admin.
Am followed below steps , but am getting an ModuleNotFoundError.
Please help.

(myenv) E:\Apache-Superset\myenv\Scripts>set FLASK_APP=superset

(myenv) E:\Apache-Superset\myenv\Scripts>flask fab create-admin
Traceback (most recent call last):
File "c:\python\python36\Lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\python\python36\Lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "E:\Apache-Superset\myenv\Scripts\flask.exe_main
.py", line 9, in
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 513, in main
cli.main(args=args, prog_name=name)
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 377, in main
obj = ScriptInfo(create_app=self.create_app)
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 205, in init
app_import_path = find_default_import_path()
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 119, in find_default_import_path
return prepare_exec_for_file(app)
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 66, in prepare_exec_for_file
'extension to .py' % filename)
flask.cli.NoAppException: The file provided (superset) does exist but is not a valid Python file. This means that it cannot be used as application. Please change the extension to .py

#copied the superset file to another location and changed the extension to .py
(myenv) E:\Apache-Superset\myenv\Scripts>set FLASK_APP=E:\Apache-Superset\superset.py

(myenv) E:\Apache-Superset\myenv\Scripts>flask fab create-admin
Username [admin]: admin
User first name [admin]: admin
User last name [user]: admin
Email [admin@fab.org]: admin
Password:
Repeat for confirmation:
Traceback (most recent call last):
File "c:\python\python36\Lib\runpy.py", line 193, in _run_module_as_main
"main", mod_spec)
File "c:\python\python36\Lib\runpy.py", line 85, in run_code
exec(code, run_globals)
File "E:\Apache-Superset\myenv\Scripts\flask.exe_main
.py", line 9, in
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 513, in main
cli.main(args=args, prog_name=name)
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 380, in main
return AppGroup.main(self, *args, **kwargs)
File "e:\apache-superset\myenv\lib\site-packages\click\core.py", line 697, in main
rv = self.invoke(ctx)
File "e:\apache-superset\myenv\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "e:\apache-superset\myenv\lib\site-packages\click\core.py", line 1066, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "e:\apache-superset\myenv\lib\site-packages\click\core.py", line 895, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "e:\apache-superset\myenv\lib\site-packages\click\core.py", line 535, in invoke
return callback(*args, **kwargs)
File "e:\apache-superset\myenv\lib\site-packages\click\decorators.py", line 17, in new_func
return f(get_current_context(), *args, **kwargs)
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 256, in decorator
with __ctx.ensure_object(ScriptInfo).load_app().app_context():
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 237, in load_app
rv = locate_app(self.app_import_path)
File "e:\apache-superset\myenv\lib\site-packages\flask\cli.py", line 90, in locate_app
import(module)
File "E:\Apache-Superset\superset.py", line 6, in
from superset.cli import create_app
ModuleNotFoundError: No module named 'superset.cli'; 'superset' is not a package

@issue-label-bot issue-label-bot bot added the !deprecated-label:bug Deprecated label - Use #bug instead label Jul 29, 2019
@issue-label-bot
Copy link

Issue-Label Bot is automatically applying the label #bug to this issue, with a confidence of 0.55. Please mark this comment with 👍 or 👎 to give our bot feedback!

Links: app homepage, dashboard and code for this bot.

@dpgaspar
Copy link
Member

pip freeze and check if superset is installed

@harish345
Copy link
Author

superset is installed but am facing the issue when am trying to create credential for the flask app using command flask fab create-admin

I have set the environment FLASK_APP variable
set FLASK_APP=E:\Apache-Superset\superset.py

so when am creating the credentials, am getting the above error i.e ModuleNotFoundError: No module named 'superset.cli'; 'superset' is not a package.

image

@dpgaspar
Copy link
Member

Hi @harish345,

Windows is not supported, having said that, your FLASK_APP env var is wrong, please read:

Video:

@Kir89
Copy link

Kir89 commented Aug 21, 2019

I think there might be some kind of a problem in the installation procedure. I am working on Ubuntu 18.04.2 LTS and I faced the same issue. The point is Flask wants a *.py file but if you rename it then you will get another error after you type in the admin user details: "ModuleNotFoundError: No module named 'superset.cli'; 'superset' is not a package". Having both versions of the file (with and without ".py") does not help.
I worked around this by keeping the file named "superset.py" until the CLI prompted for the username and the password. Then, before filling the user details, I renamed back the file to "superset". Hope this could be of some help

@stale
Copy link

stale bot commented Oct 20, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions. For admin, please label this issue .pinned to prevent stale bot from closing the issue.

@stale stale bot added the inactive Inactive for >= 30 days label Oct 20, 2019
@stale stale bot closed this as completed Oct 27, 2019
@shailendrasingh98
Copy link

I am facing same issue in mac. trying to install apache/superset:1.3.2 using docker compose and fails with below error.
Init Step 1/4 [Starting] -- Applying DB migrations

######################################################################

Loaded your LOCAL configuration at [/app/docker/pythonpath_dev/superset_config.py]

Traceback (most recent call last):

File "/usr/local/bin/superset", line 33, in

sys.exit(load_entry_point('apache-superset', 'console_scripts', 'superset')())

File "/usr/local/bin/superset", line 25, in importlib_load_entry_point

return next(matches).load()

File "/usr/local/lib/python3.8/importlib/metadata.py", line 77, in load

module = import_module(match.group('module'))

File "/usr/local/lib/python3.8/importlib/init.py", line 127, in import_module

return _bootstrap._gcd_import(name[level:], package, level)

File "", line 1014, in _gcd_import

File "", line 991, in _find_and_load

File "", line 970, in _find_and_load_unlocked

ModuleNotFoundError: No module named 'superset.cli.main'; 'superset.cli' is not a package

@nghilethanh-atherlabs
Copy link

any one resolve this bug ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
!deprecated-label:bug Deprecated label - Use #bug instead inactive Inactive for >= 30 days
Projects
None yet
Development

No branches or pull requests

5 participants