Mars2024
Mars2024

Reputation: 394

Docker image error: /bin/sh: 1: python: not found

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

Upvotes: 0

Views: 2263

Answers (2)

AKX
AKX

Reputation: 168824

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 . .

Upvotes: 2

user3667054
user3667054

Reputation: 191

In the terminal of vscode, type sudo apt install python-is-python3 then restart, it should work.

Upvotes: 1

Related Questions