unwilling-turquoise
unwilling-turquoise2y ago

How can I deploy Playwright Python script on Heroku?

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\ ║ . . .
10 Replies
conventional-tan
conventional-tan2y ago
@Soul_Denied ツ Hi, its missing dependencies error, will need to install them before deploy
unwilling-turquoise
unwilling-turquoiseOP2y ago
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
playwright install && python3 main.py
also I tried this in my code.
if os.getenv("RUN_MODE", "DEV") == "PROD":
print("RUN MODE: PROD")
subprocess.run(["playwright", "install"])
if os.getenv("RUN_MODE", "DEV") == "PROD":
print("RUN MODE: PROD")
subprocess.run(["playwright", "install"])
but I am getting the issue mentioned in the question.
MEE6
MEE62y ago
@Soul_Denied ツ just advanced to level 1! Thanks for your contributions! 🎉
unwilling-turquoise
unwilling-turquoiseOP2y ago
@Mathew 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
conventional-tan
conventional-tan2y ago
@Soul_Denied ツ 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
unwilling-turquoise
unwilling-turquoiseOP2y ago
How I can setup on Heroku? I found documentations for Node JS. but for python not able to find out.
conventional-tan
conventional-tan2y ago
I had no experience with playwright on heroku, maybe I can see the Node documentation?
conventional-tan
conventional-tan2y ago
ok, may I see your app's setting on heroku dashboard?
unwilling-turquoise
unwilling-turquoiseOP2y ago
which setting you wanna see?

Did you find this page helpful?