Closed AlexKay28 closed 1 year ago
I was able to get this working by running the docker container with --privileged
. Not ideal, but a temporary workaround until I determine what permissions are required for dataframe_image to write the png file
I was able to resolve this in a more secure manner by following this post. I am now able to save a table to png in a docker image without having to run as --privileged
@rogfut thanks you for you answer, but I still have a problem I have tried both variants:
privileged: true
string in my docker-composesecurity_opt:
- "seccomp=./chrome.json"
both times I got an error:
[0928/124915.366587:ERROR:zygote_host_impl_linux.cc(90)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
Could you please describe what you have done in more detail?
@rogfut As I understand, setting "--no-sandbox" parameter while running under a root should solve the problem but is not clear to me how I should set this value if I run chromium latently (
I decided to use custom user
It helps me avoid --no-sandbox problem, but SyntaxError: not a PNG file
error still exists without privileged: true. (I do not have any permissions problem while running by the way)
as a decision for me yet:
=(
any update on this? still facing the same issue in python-docker.
@ShiraUnger , have you tried the latest 0.1.2 version?
With setting dataframe_image to version 0.1.2 i still have the issue
FROM ubuntu:22.04
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update; apt install -y python3-pip
RUN pip install jupyter tqdm pandas==1.4 numpy seaborn==0.11 matplotlib scipy dataframe_image==0.1.2
RUN apt-get update && apt install chromium-driver libpng-dev tree -y
With setting dataframe_image to version 0.1.2 i still have the issue
FROM ubuntu:22.04 ARG DEBIAN_FRONTEND=noninteractive RUN apt update; apt install -y python3-pip RUN pip install jupyter tqdm pandas==1.4 numpy seaborn==0.11 matplotlib scipy dataframe_image==0.1.2 RUN apt-get update && apt install chromium-driver libpng-dev tree -y
I have tried the same image and found error is different:
Python 3.8.10 (default, Jun 22 2022, 20:18:18)
[GCC 9.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd
>>> df = pd.DataFrame({"1": [1, 2, 3], "2":[5, 1, 5]})
>>> import dataframe_image as dfi
>>> dfi.export(df, "pic.png")
Command '/usr/bin/chromium-browser' requires the chromium snap to be installed.
Please install it with:
snap install chromium
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python3.8/dist-packages/dataframe_image/_pandas_accessor.py", line 48, in export
return _export(
File "/usr/local/lib/python3.8/dist-packages/dataframe_image/_pandas_accessor.py", line 117, in _export
img_str = converter(html)
Follow this question https://askubuntu.com/questions/1204571/how-to-install-chromium-without-snap
Or use Debian based images
Move temp html directory under $HOME
in 0.2.0 and should solve this problem.
Hey there!) I got some problems using the package in docker. I got this traceback inside:
Dockerfile with relevant to the issue part:
I do use: dataframe-image==0.1.1; matplotlib==3.3.4 I have installed chromedriver ChromeDriver 90.0.4430.212
you can also see libpng-dev installation, it was one of my tries to fix the problem.. so I guess that image may not contains needed utils for the correct working of chromedriver
maybe this problem has already been solved or, can you list what dependencies are needed tho? Thank you!)