添加链接
link管理
链接快照平台
  • 输入网页链接,自动生成快照
  • 标签化管理网页链接
相关文章推荐
风流倜傥的炒粉  ·  Frappe Cloud custom ...·  1 月前    · 
爱搭讪的猴子  ·  [Arch Linux] expected ...·  1 月前    · 
霸气的毛衣  ·  ERROR: Error loading ...·  2 周前    · 
傻傻的茴香  ·  Apache Friends ...·  10 月前    · 
性感的绿豆  ·  SQL ...·  10 月前    · 
没有腹肌的围巾  ·  运行pyscenic ...·  1 年前    · 
刚分手的牙膏  ·  使用Python ...·  1 年前    · 

I’ve been trying to create an docker image to run fbprohet and streamlit. When i run the docker run command i get the below error.

I’ve stuck on this issue for a number of days now. Any help would be appreciated.

Thanks,

     $ docker run <image-id> streamlit hello
    Generate machine-id
    Traceback (most recent call last):
      File "/usr/local/bin/streamlit", line 5, in <module>
        from streamlit.cli import main
      File "/usr/local/lib/python3.7/site-packages/streamlit/__init__.py", line 74, in <module>
        subprocess.run(["sudo", "dbus-uuidgen", "--ensure"])
      File "/usr/local/lib/python3.7/subprocess.py", line 488, in run
        with Popen(*popenargs, **kwargs) as process:
      File "/usr/local/lib/python3.7/subprocess.py", line 800, in __init__
        restore_signals, start_new_session)
      File "/usr/local/lib/python3.7/subprocess.py", line 1551, in _execute_child
        raise child_exception_type(errno_num, err_msg, err_filename)
    FileNotFoundError: [Errno 2] No such file or directory: 'sudo': 'sudo'

Dockerfile

FROM python:3.7-alpine
WORKDIR /workspace
COPY requirements.txt .
RUN apk add --no-cache python3 python3-dev build-base libffi-dev openssl-dev curl krb5-dev linux-headers zeromq-dev jpeg-dev zlib-dev && \
    python3 -m ensurepip && \
    rm -r /usr/lib/python*/ensurepip && \
    pip3 install --upgrade pip setuptools && \
    if [ ! -e /usr/bin/pip ]; then ln -s pip3 /usr/bin/pip ; fi && \
    if [[ ! -e /usr/bin/python ]]; then ln -sf /usr/bin/python3 /usr/bin/python; fi && \
    rm -r /root/.cache
RUN apk --update add --no-cache gcc freetype-dev libpng-dev
RUN apk add --no-cache --virtual .build-deps \
    musl-dev \
RUN pip install -r requirements.txt --no-cache-dir 
# removing dependencies
RUN apk del .build-deps
EXPOSE 9999
              

Hi @zalam, welcome to the Streamlit community! (and sorry the StackOverflow person was a jerk to you)

I wrote my suspected answer on SO, but I’ll copy it here for everyone else:
stackoverflow.com

To me, it looks like we are requiring sudo to be installed in the environment, so if you add sudo to your apk add statement, it might work. Separately, I’m checking with our engineering group to understand why we require sudo and whether we can get that removed in a future release.

Best,
Randy

Thanks @randyzwitch

I managed to sort the issue by changing the base python image. Will go back an look at implementing you suggestion to see if that works.

Thanks for your response :smile: :sparkling_heart: Streamlit!!!

I am encountering this error FileNotFoundError: [Errno 2] No such file or directory: 'sudo' when running streamlit on AWS App Runner. Strangely I do not receive this error when running locally via docker.

@randyzwitch did you get anywhere with checking sudo and whether we can get that removed, strikes me as not desirable behaviour?

I suppose the problem could also be solved by using an apprunner.yaml file for the AWS App Runner configuration.

https://docs.aws.amazon.com/apprunner/latest/dg/service-source-code-python.html

Can you run something like this in the Build command field?

apk --no-cache add sudo && pip install -r requirements.txt

By the way, if this doesn’t work, you will also have problems to install additional packages with packages.txt at all!? :thinking:

Ive had quite an education afternoon. After switching base image to python3.8, pushing to a private ECR repo I got role permissions errors, even though all appears to be in order. The switched to public ECR repo and finally got the app depolyed, only to get more errors since I built the image on an ARM Mac and this is incompatible with aws instace (TBC) - error standard_init_linux.go:219: exec user process caused: exec format error`.

Dear all,

I am trying to deploy my streamlit app on docker.
I successfully deployed my streamlit app using docker but its not connecting the url generated : http://172.17.0.2:8501

It is showing this site cant be reached…refused to connect …

Commands used:

docker build -t billing:latest . (to build image)

docker run -p 8501:8501 billing:latest ( expose)

Dockerfile:
FROM python:3.7

WORKDIR /app

COPY requirements.txt ./requirements.txt

RUN pip3 install -r requirements.txt

EXPOSE 8501

COPY . /app

ENTRYPOINT [“streamlit”,“run”]

CMD [“billing_app_main_copy.py”]

image1366×768 73.7 KB image1366×768 73.5 KB

Kindly help…what to do? I am new to deploying and have deployed on streamlit sharing only.

Regards

  • I don’t know what the second screenshot is supposed to say?
  • Check the docker logs for any error messages.
  • Where is the Docker container running? On the local Windows system? Then try it with http://localhost:8501/ Thanks for stopping by! We use cookies to help us understand how you interact with our website. By clicking “Accept all”, you consent to our use of cookies. For more information, please see our privacy policy.

    Strictly necessary cookies

    These cookies are necessary for the website to function and cannot be switched off. They are usually only set in response to actions made by you which amount to a request for services, such as setting your privacy preferences, logging in or filling in forms.

    Performance cookies

    These cookies allow us to count visits and traffic sources so we can measure and improve the performance of our site. They help us understand how visitors move around the site and which pages are most frequently visited.

    Functional cookies

    These cookies are used to record your choices and settings, maintain your preferences over time and recognize you when you return to our website. These cookies help us to personalize our content for you and remember your preferences.

    Targeting cookies

    These cookies may be deployed to our site by our advertising partners to build a profile of your interest and provide you with content that is relevant to you, including showing you relevant ads on other websites.

    Reject all Accept all
  •