Chrome / Chrome Driver paths
Has anyone figured a good way to get the chrome path / install chrome driver if necessary? Using python.
36 Replies
Project ID:
N/A
You might find these helpful:
- Path of a Nixpacks (google-chrome, chromedriver) [Python]
⚠️ experimental feature
N/A
Maybe this would work, how to run "apt install chromium-chromedriver" on build?
add a NIXPACKS_APT_PKGS=chromium-chromedriver environment variable.
"Command '/bin/chromium-browser' requires the chromium snap to be installed."
:augh: ubuntu
uhm
#🎤|chit-chat - add NIXPACKS_DEBIAN=1 to your environment variables.
@HairyBarry let us know how it goes
executor failed running [/bin/bash -ol pipefail -c apt-get update && apt-get install -y --no-install-recommends chromium-chromedriver]: exit code: 1
Error: Docker build failed
more logs pls
What about how to install nix packages "chromedriver" and "google-chrome"?
#9 [stage-0 5/9] RUN apt-get update && apt-get install -y --no-install-recommends chromium-chromedriver
#9 sha256:94a3705aa14f16b7b7a54fec590814404cdec4dbfbc3f6287f831ef06ab67941
#9 0.456 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version
GLIBC_2.33' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#9 0.456 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version
GLIBC_2.32' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#9 0.456 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version GLIBC_2.34' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libstdc++.so.6)
#9 0.456 apt-get: /lib/x86_64-linux-gnu/libc.so.6: version
GLIBC_2.34' not found (required by /nix/store/c8zdsf7csk8msjb914bhccdhq0ycmqys-gcc-11.3.0-lib/lib/libgcc_s.so.1)
#9 ERROR: executor failed running [/bin/bash -ol pipefail -c apt-get update && apt-get install -y --no-install-recommends chromium-chromedriver]: exit code: 1
#8 42.01 17 store paths deleted, 156.17 MiB freedshared objects
@aleks u wanna have some fun with this or na
oh wait I'm stupid
you can use nix I think
Instead of NIXPACKS_APT_PKGS and NIXPACKS_DEBIAN, just put in NIXPACKS_PKGS=chromedriver
Seems that worked to install the chromedriver. For my app, i need to reference the chrome path. Any idea how to find that?
Try calling out to the shell with
which google-chrome
If you need the filesystem root, run nix-store -q $(which google-chrome)
How to do this?
Like how do I call out to the shell?
I'm not sure. I think it's
os.system
or somethingOk i found the path to chrome but this is the error i get thrown when using it:
[0224/183825.677310:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[0224/183825.677730:ERROR:bus.cc(399)] Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory
[0224/183825.680655:WARNING:bluez_dbus_manager.cc(247)] Floss manager not present, cannot set Floss enable/disable.
[0224/183825.708983:WARNING:sandbox_linux.cc(380)] InitializeSandbox() called with multiple threads in process gpu-process.
[0224/183825.798524:ERROR:process_memory_range.cc(75)] read out of range
[0224/183825.801605:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_cur_freq: No such file or directory (2)
[0224/183825.801647:ERROR:file_io_posix.cc(144)] open /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq: No such file or directory (2)
[0224/183826.115015:ERROR:headless_shell.cc(397)] Abnormal renderer termination.
"This buildpack installs shims that always add --headless, --disable-gpu, --no-sandbox, and --remote-debugging-port=9222 to any google-chrome command as you'll have trouble running Chrome on a Heroku dyno otherwise."
This is from the heroku-buildpack-google-chrome docs. Maybe could solve the last error. Any ideas how to do this on railway?
"Failed to connect to the bus: Failed to connect to socket /run/dbus/system_bus_socket: No such file or directory" any ideas on this error?
i see youve been having problems with this for a few days now, im willing to take a crack at this if you can provide a minimal reproducible example for me to work with, though i make no promises
import pandas as pd
import dataframe_image as dfi
data = [['tom', 43], ['nick', 55], ['juli', 28]]
df = pd.DataFrame(data, columns=['Name', 'Age']) dfi.export(df, "df.png", chrome_path="/root/.nix-profile/bin/chromium") NIXPACKS_PKGS=ungoogled-chromium (or google-chrome in which case chrome_path="/root/.nix-profile/bin/google-chrome-stable")
df = pd.DataFrame(data, columns=['Name', 'Age']) dfi.export(df, "df.png", chrome_path="/root/.nix-profile/bin/chromium") NIXPACKS_PKGS=ungoogled-chromium (or google-chrome in which case chrome_path="/root/.nix-profile/bin/google-chrome-stable")
hmm okay, not much to go off of, but ill try
GitHub
GitHub - dexplo/dataframe_image: A python package for embedding pan...
A python package for embedding pandas DataFrames as images into pdf and markdown documents - GitHub - dexplo/dataframe_image: A python package for embedding pandas DataFrames as images into pdf and...
This is the package of the "export" function that fails
GitHub
SyntaxError: not a PNG file · Issue #68 · dexplo/dataframe_image
Hi, I've been using the dataframe-image package for some time and as of this week it stopped working for me. The relevant code is simply: dfi.export(cal_sorted,"Earnings Calendar &...
And discussion related to chrome
Procfile
web: python bot/main.py
cool ill try to get this running on railway, no promises so dont get your hopes up
heck ya, thanks for the help
bro you should just use matplotlib
Using Chrome to do things is usually always a bad idea anyway
So yeah I can't get it to work with chrome, sorry
ya only thing is with matplotlib i lose formatting
in my app i export a "styler" (formatted dataframe) but lose the formatting if i export the styler with matplotlib
there has to be a better way than using chrome
i think i got it to work by reading the heroku-buildpack-google-chrome docs
had to install helper apt packages
do share how you did it
it still throws this error and a few warnings but exports the image correctly
well im sorry i couldn't have been more help, but if it works it works i guess
🤷♂️
NIXPACKS_APT_PKGS=fonts-liberation,libappindicator3-1,libasound2,libatk-bridge2.0-0,libatk1.0-0,libgbm1,libgtk-3-0,libnspr4,libnss3,libx11-xcb1,libxcomposite1,libxcursor1,libxdamage1,libxfixes3,libxi6,libxrandr2,libxss1,libxtst6,xdg-utils,gconf-service,libgconf-2-4
if anyones reading this try this^ lol
GitHub
GitHub - ryannono/Puppeteer-Railway-Buildpack: Installs dependencie...
Installs dependencies needed in order to run puppeteer on Railway. - GitHub - ryannono/Puppeteer-Railway-Buildpack: Installs dependencies needed in order to run puppeteer on Railway.
thanks anyway, its been a headache