Home > Mobile >  Docker image error: /bin/sh: 1: python: not found | DIFFERENT FROM 2015 question
Docker image error: /bin/sh: 1: python: not found | DIFFERENT FROM 2015 question

Time:07-05

Here's the similar question, except I have a different Dockerfile setup. Dockerfile 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

CodePudding user response:

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

CodePudding user response:

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

  • Related