Sign inSign up

jysgro/benford-streamlit

By jysgro

•Updated almost 3 years ago

Image
0

978

jysgro/benford-streamlit repository overview

CURRENTLY NOT WORKING IN DOCKER....

I had to add protobuf==3.19.* (See stackoverflow⁠ reporting same error.)

After this correction I see the same errors as those given by the original Docker Image which are many... Starts with:

Traceback (most recent call last):
  File "/usr/local/bin/streamlit", line 8, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.8/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)

Continue and ends with:

 File "/usr/local/lib/python3.8/site-packages/watchdog/observers/inotify_buffer.py", line 35, in __init__
    self._inotify = Inotify(path, recursive)
  File "/usr/local/lib/python3.8/site-packages/watchdog/observers/inotify_c.py", line 155, in __init__
    Inotify._raise_error()
  File "/usr/local/lib/python3.8/site-packages/watchdog/observers/inotify_c.py", line 405, in _raise_error
    raise OSError(err, os.strerror(err))
OSError: [Errno 38] Function not implemented

HOWEVER, COMPILES on macOS (13.6.2 - Ventura, M1Max chip)

git clone https://github.com/milcent/benford-streamlit.git
cd benford-streamlit
python -m venv venv
source venv/bin/activate
python -m pip install --upgrade pip
python -m pip install -r requirements.txt

BUT REQUIRED THIS CHANGE:

Jinja2 was automatically installed as version 3.1.2. Can be verified with: pip show Jinja2.

From original post, I could conclude that the last update on GitHub was May 31, 2021. Checking on Jinja2 documentation at https://jinja.palletsprojects.com/en/3.1.x/changes/#version-3-0-1⁠ I concluded that the author must have used version Jinja2 3.0.1. (From info at https://stackoverflow.com/questions/71645272/importerror-cannot-import-name-markup-from-jinja2⁠)

So the following allowed this to work on the Mac (M1)

pip uninstall Jinja2
pip install Jinja2==3.0.1

Replied was:

Requirement already satisfied: MarkupSafe>=2.0 in ./venv/lib/python3.11/site-packages (from Jinja2==3.0.1) (2.1.3)

After that: Note that the suggested command was streamlit run benford-analysis.py but the file in the GitHub repo has an underscore instead: benford_analysis.py

streamlit run benford_analysis.py

Then open a browser if it did not start automatically

  You can now view your Streamlit app in your browser.

  Local URL: http://localhost:8501
  Network URL: http://x.x.x.x:8501 # x number will vary with network.

Ctrl-C to end...

IN THE BROWSER. select files works, but after the first plot no other menu is working.

The workaround is to make each column of the CSV file into a separate file.

But only the "First digit" which is shown by default can be shown, as no mneu is reponsive after that...


As of today (DEc 05, 2023) this does not work either (Quoting from https://discuss.streamlit.io/t/interactive-benford-analysis/13780⁠)


⁠Inspiration:

⁠Run with:

docker run --rm -p 8501:8501 jysgro/benford-streamlit

⁠Notes

  • I tried to compile for arm64 but had too many errors, so it's just amd64.
  • I cloned the GitHub repo as a back-up. (jsgro/benford-streamlit⁠.)

Macintosh Silicon (M1/M2,etc.) need to pull first specifying the amd64 platform:

docker pull --platform linux/amd64  jysgro/benford-streamlit:latest      

⁠Dockerfile

See original at milcent/benford-streamlit⁠

Only added the pip upgrade suggested when compiling.

FROM python:3.8.10-slim

LABEL maintainer="Marcel Milcent"
LABEL version="0.1.0"
LABEL maintainer-email="[email protected]"

COPY . /benford-streamlit

WORKDIR /benford-streamlit

RUN /usr/local/bin/python -m pip install --upgrade pip &&\
    pip install -r requirements.txt

EXPOSE 8501

ENTRYPOINT ["streamlit", "run"]

CMD ["benford_analysis.py"]

Tag summary

Content type

Image

Digest

sha256:88167b35a…

Size

330.4 MB

Last updated

almost 3 years ago

docker pull jysgro/benford-streamlit