streamlit's webserver not working when using BAZEL for installation bug
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Start with the streamlit_main.py and BUILD.bazel reproduction, then locate the development-mode check described in the issue. Run "bazel build streamlit_main" and verify that the resulting application does not run in development mode without the workaround; the issue does not name the implementation file or a test.
Written by the indexing model from the issue text.
Description
Summary
Related to https://github.com/streamlit/streamlit/issues/3132 .
An internal check to see if streamlit is running in development mode or not. This checks if some strings are present in the script's file path. This check is not valid for other installation types, e.g. bazel.
The script path in a bazel build is for example:
/home/{user}/.cache/bazel/_bazel_{user}/b775940771a888524b9eed82a7f43708/execroot/{organization}/bazel-out/k8-fastbuild/bin/apps/daq/streamlit_main.runfiles/pip_deps_pypi__streamlit/streamlit/hello/hello.py
This could be solved by also checking for "pip_deps_pypi__streamlit" in the development_mode check, or by just having a better check in general.
Steps to reproduce
Code snippet:
streamlit_main.py
import sys
from streamlit import cli as stcli
if __name__ == '__main__':
sys.argv = ["streamlit", "hello"]
sys.exit(stcli.main())
BUILD.bazel
load("@rules_python//python:defs.bzl", "py_binary")
py_binary(
name = "streamlit_main",
srcs = [
"streamlit_main.py",
],
main = "streamlit_main.py",
visibility = ["//visibility:public"],
deps = [
requirement('streamlit')
],
)
If applicable, please provide the steps we should take to reproduce the bug:
run "bazel build streamlit_main"
Expected behavior:
To not run in development mode;
Actual behavior:
Runs in development mode.
Is this a regression?
no
Debug info
- Streamlit version: 1.8.1
- Python version: 3.7
- Using Conda? PipEnv? PyEnv? Pex? BAZEL
- OS version: Ubuntu 20.04
- Browser version:
Additional information
Workaround: explicitly set developmentMode to false:
import sys
from streamlit import cli as stcli
if __name__ == '__main__':
sys.argv = ["streamlit", "hello", "--global.developmentMode", "0"]
sys.exit(stcli.main())
- Dominant language
- Python
- Stars
- 45.8k
- Forks
- 4.4k
- Avg merge
- 21h 22m
- Merged PRs (30d)
- 316
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from streamlit/streamlit
-
area:backend area:network feature:embedding feature:runtime priority:P3 status:confirmed type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:frontend area:security feature:st.file_uploader status:unlikely type:enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
area:backend area:security feature:cache feature:cache-hash-func priority:P4 status:confirmed type:bug
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:mobile feature:st.camera_input papercut type:enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
area:ai type:enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
All issues in streamlit/streamlit
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
bancolombia/sentinel#23 ·
-
test md OpenCI
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
integration:quickjs org:external priority:backlog topic:code-interpreter topic:middleware type:feature
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
langchain-ai/deepagents#6450 ·
-
bug client
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100