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

No virtual environment found; run uv venv to create an environment #31600

Open
3 tasks
small-flowers opened this issue Dec 23, 2024 · 10 comments · May be fixed by #31606
Open
3 tasks

No virtual environment found; run uv venv to create an environment #31600

small-flowers opened this issue Dec 23, 2024 · 10 comments · May be fixed by #31606
Assignees
Labels
install:docker Installation - docker container

Comments

@small-flowers
Copy link

Bug description

I follow the quickstart guide and at the step of
docker compose -f docker-compose-image-tag.yml up
It downloaded all the images and after the DB and REDIS containers initialized all the other containers were constantly spamming the output with messages like:
Collecting uv
Downloading uv-0.5.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB)
Downloading uv-0.5.11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (15.0 MB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 15.0/15.0 MB 136.0 MB/s eta 0:00:00
Installing collected packages: uv
Successfully installed uv-0.5.11
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.
Reinstalling the app in editable mode
error: No virtual environment found; run uv venv to create an environment, or pass --system to install into a non-virtual environment
Requirement already satisfied: uv in /usr/local/lib/python3.10/site-packages (0.5.11)
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable.It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

Screenshots/recordings

image

Superset version

master / latest-dev

Python version

3.9

Node version

16

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.
Copy link

dosubot bot commented Dec 23, 2024

Hello @small-flowers! I'm here to help you with any bugs, questions, or contributions. Let's tackle this issue together.

The issue you're encountering seems to be related to the setup of the virtual environment within the Docker container. The error message suggests that a virtual environment is not found, and it recommends running uv venv to create one.

In the Superset Docker setup, the uv tool is used to manage virtual environments and install Python packages because it is considered faster and simpler than using pip directly [1]. The Dockerfile should include steps to create a virtual environment using uv, but it seems like this step might not have been executed correctly in your setup.

Here are a few things you can check or try:

  1. Ensure Dockerfile Execution: Make sure that the Dockerfile is correctly executing the command to create the virtual environment. This typically looks like:

    RUN uv venv /app/.venv
    ENV PATH="/app/.venv/bin:${PATH}"
  2. Rebuild the Docker Image: Sometimes, rebuilding the Docker image can resolve issues with missing steps. You can do this by running:

    docker compose -f docker-compose-image-tag.yml build --no-cache
  3. Check Dockerfile for Modifications: Ensure that there are no modifications or errors in the Dockerfile that might prevent the virtual environment from being created.

  4. Verify Docker Compose Configuration: Ensure that the docker-compose-image-tag.yml file is correctly set up and that it uses the appropriate image tag for the Superset version you are trying to run [2].

If these steps do not resolve the issue, you might want to manually check the Dockerfile and the docker-compose-image-tag.yml file to ensure all configurations are correct and that the virtual environment creation step is included and executed properly.

To continue talking to Dosu, mention @dosu.


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

@dosubot dosubot bot added the install:docker Installation - docker container label Dec 23, 2024
@sino1641
Copy link

sino1641 commented Dec 23, 2024

Hi, I am also new to try the project.
Please add apt-get update && apt-get install -y build-essential to the front of docker/docker-bootstrap.sh
The project is not set as out of box, but a lot of documents/discussions should be read before you really take practice.

@small-flowers
Copy link
Author

I added docker/dockerbootstrap. sh to the file, but restarting the service still produces an error:
image
image

@sino1641
Copy link

Hi so it seems like a different scenario from my situation.
Generally, there are two methods:

  1. replace all uv pip install to uv pip install --system:
    sed -i 's/uv pip install/uv pip install --system/g' docker/docker-bootstrap.sh
  2. create a venv :
    uv venv .venv
    source .venv/bin/activate
    Snipaste_2024-12-23_20-14-47

@mistercrunch
Copy link
Member

Quick workaround is to git checkout 4.1.1 prior to docker-compose up.

I need to figure out a way to make the latest docker-compose.*.yml compatible with the previous releases' docker builds.

@mistercrunch
Copy link
Member

#31606

@mistercrunch mistercrunch linked a pull request Dec 23, 2024 that will close this issue
@small-flowers
Copy link
Author

嗨,我也是第一次尝试这个项目。 请将其添加apt-get update && apt-get install -y build-essential到docker/docker-bootstrap.sh的前面。 该项目并非开箱即用,但在真正开始实践之前,应该阅读大量文档/讨论。

我把docker/dockerbootstrap.sh添加到文件中,但是重启服务还是报错: 图像 图像

Hi so it seems like a different scenario from my situation. Generally, there are two methods:

  1. replace all uv pip install to uv pip install --system:
    sed -i 's/uv pip install/uv pip install --system/g' docker/docker-bootstrap.sh

  2. create a venv :

    uv venv .venv
    source .venv/bin/activate
    Snipaste_2024-12-23_20-14-47

I added this configuration and the error was resolved, but there are new errors:
Original exception:

ModuleNotFoundError: No module named 'pkg_resources'
image

@zytfo
Copy link

zytfo commented Dec 24, 2024

ModuleNotFoundError: No module named 'pkg_resources'

I solved this by adding setuptools in docker/requirements-local.txt

@small-flowers
Copy link
Author

After deployment is complete, the configuration alarm selection email keeps loading:
image

@mistercrunch
Copy link
Member

the configuration alarm selection email keeps loading

Seems like an unrelated issue.

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