#How can I deploy Playwright Python script on Heroku?

1 messages · Page 1 of 1 (latest)

icy rivet
#

I am trying to deploy my code on Heroku.
using : python3

getting this error on Heroku console.
╔══════════════════════════════════════════════════════╗
║ Host system is missing dependencies to run browsers. ║ ║ Please install them with the following command: ║
║ ║
║ sudo playwright install-deps ║
║ ║
║ Alternatively, use apt: ║
║ sudo apt-get install libatk1.0-0\ ║
║ libatk-bridge2.0-0\ ║
.
.
.

tough elbow
#

@icy rivet Hi, its missing dependencies error, will need to install them before deploy

icy rivet
#

as we need to install dependency.
in my local machine. I use

playwright install

and same thing I am doing on my Heroku app.
I tried writing this in my Procfile

playwright install && python3 main.py

also I tried this in my code.

    print("RUN MODE: PROD")
    subprocess.run(["playwright", "install"])

but I am getting the issue mentioned in the question.

knotty kiteBOT
#

@icy rivet just advanced to level 1! Thanks for your contributions! 🎉

icy rivet
#

@tough elbow later onward when that error comes up.
I tried using same way to run this command.

sudo playwright install-deps

but this not being executed in the heroku

tough elbow
#

@icy rivet well, heroku may not support playwright installing and running on it's env.
I guess it works on local with no error.

#

if you need it deployed on cloud server, you will have to set up a server

icy rivet
#

How I can setup on Heroku?

#

I found documentations for Node JS. but for python not able to find out.

tough elbow
#

I had no experience with playwright on heroku, maybe I can see the Node documentation?

tough elbow
#

ok, may I see your app's setting on heroku dashboard?