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' #31360

Closed
3 tasks done
kalyan540 opened this issue Dec 9, 2024 · 5 comments · Fixed by #31385
Closed
3 tasks done

ModuleNotFoundError: No module named 'superset' #31360

kalyan540 opened this issue Dec 9, 2024 · 5 comments · Fixed by #31385
Labels
install:docker Installation - docker container

Comments

@kalyan540
Copy link

kalyan540 commented Dec 9, 2024

Bug description

The Bug is with the latest superset installation, when this command executed 'sudo docker compose up' in ubuntu 24.

superset_init | Skipping local overrides superset_init | Unknown Operation!!! superset_init | superset_init | ###################################################################### superset_init | superset_init | superset_init | Init Step 1/4 [Starting] -- Applying DB migrations superset_init | superset_init | superset_init | ###################################################################### superset_init | superset_init | Traceback (most recent call last): superset_init | File "/usr/local/bin/superset", line 5, in <module> superset_init | from superset.cli.main import superset superset_init | ModuleNotFoundError: No module named 'superset' superset_init exited with code 1

Screenshots/recordings

image

Superset version

master / latest-dev

Python version

3.11

Node version

18 or greater

Browser

Chrome

Additional context

No response

Checklist

  • I have searched Superset docs and Slack and didn't find a solution to my problem.
  • I have searched the GitHub issue tracker and didn't find a similar bug report.
  • I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.
@dosubot dosubot bot added the install:docker Installation - docker container label Dec 9, 2024
Copy link

dosubot bot commented Dec 9, 2024

There is a similar unsolved discussion titled ModuleNotFoundError: No module named 'superset' that might be relevant to your issue [1].

To address the ModuleNotFoundError in a Docker environment for Superset, ensure that the Docker setup process is correctly followed. Here are some steps you can verify:

  1. Ensure Docker and Docker Compose are installed: Make sure you have the latest versions of Docker and Docker Compose installed on your system.

  2. Clone the Superset repository: If you haven't already, clone the repository using:

    git clone https://github.com/apache/superset
  3. Navigate to the Superset directory:

    cd superset
  4. Check the Docker Compose file: Ensure you are using the correct Docker Compose file. For development, you might use:

    docker compose -f docker-compose-image-tag.yml up
  5. Verify Python Path Configuration: The /app/pythonpath should be correctly mounted from ./docker/pythonpath_dev. Ensure that the superset_config.py is present in this directory.

  6. Rebuild the Docker images: If there are any changes or issues, try rebuilding the Docker images:

    docker compose build
  7. Check for Local Overrides: If you have any local overrides, ensure they are correctly set up in superset_config_docker.py.

If these steps do not resolve the issue, consider checking the Docker logs for more detailed error messages that might provide additional insights.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Other

@rusackas
Copy link
Member

Ok... so we're definitely having some docker problems on master - I ran into this as well as the person on the thread Dosu linked to.

I'm hopefully that others (including perhaps @mistercrunch) can help address the underlying docker compose issues, but here's a workaround that helped me get a dev environment back up and running...

  1. Spin up docker compose as normal, and it'll have problems initializing the db/migrations/user/examples... but it'll run.
  2. Go into a separate terminal and do docker exec -it superset_app /bin/bash
  3. When you get a command prompt, run the following commands:
pip install -e .
superset db upgrade
superset init
superset fab create-admin
superset load-examples

@kalyan540
Copy link
Author

@rusackas Thanks for the response and the workaround! It’s interesting that the issue linked in the thread was also one I raised and resolved earlier. I agree that addressing these Docker Compose issues in upcoming versions would be beneficial for smoother setups. Hoping @mistercrunch and the team can look into this further.

@kalyan540 kalyan540 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 10, 2024
@kalyan540 kalyan540 reopened this Dec 10, 2024
@imvuong
Copy link

imvuong commented Dec 10, 2024

Sorry I forgot where I found this solution

In the docker/.env line 49, I changed to: PYTHONPATH=/app:/app/pythonpath:/app/docker/pythonpath_dev

This fixes the problem for me.

@mistercrunch
Copy link
Member

This should help -> #31385, hoping to merge today

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
install:docker Installation - docker container
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants