skip to Main Content

Im running this dockerfile and I get: ERROR Run python -m playwright install
/bin/sh python: not found

FROM mcr.microsoft.com/playwright:focal

RUN apt-get update && apt-get install -y python3-pip
COPY . .
RUN pip3 install TikTokApi
RUN python -m playwright install // Results in error

2

Answers


  1. If you want a Playwright image with Python instead of the Playwright image with Node you have currently set,

    do

    FROM mcr.microsoft.com/playwright/python:v1.23.0-focal
    

    instead. You won’t then need to install python3-pip (or playwright!) at all.

    Additionally, you’ll probably want to explicitly spell out python3 instead of python:

    FROM mcr.microsoft.com/playwright/python:v1.23.0-focal
    RUN pip3 install TikTokApi
    RUN playwright install
    COPY . .
    
    Login or Signup to reply.
  2. In the terminal of vscode, type sudo apt install python-is-python3 then restart, it should work.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search