Skip to content

[BUG] - official docker image cannot pip install python playwright #5891

@rsalmond

Description

@rsalmond

Context:

  • Playwright Version: [what Playwright version do you use?] python playwright 1.9.2
  • Operating System: [e.g. Windows, Linux or Mac] Linux (by way of the official docker image)
  • Node.js version: [e.g. 10.12, 10.14] v14.16.0 (also by way of the official docker image)
  • Browser: [e.g. All, Chromium, Firefox, WebKit] n/a
  • Extra: [any specific details about your environment]

Describe the bug

The official docker image contains python2, python3.6, and python3.8 and it uses update-alternatives to make pip3 the default pip and python3.6 the default python. However in this configuration pip3 (which invokes python3) starts up with python3.6, since there is no update-alternatives command specifying that python3 should be python3.8. Because of this, pip/pip3 will try to search for a copy of playwright to use with python3.6, and will fail to find anything.

$ docker run -it mcr.microsoft.com/playwright:bionic bash
root@1f4ff0677fee:/# pip3 install playwright
Collecting playwright
  Could not find a version that satisfies the requirement playwright (from versions: )
No matching distribution found for playwright

root@1f4ff0677fee:/# pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)      <================

root@1f4ff0677fee:/# update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.8 10
update-alternatives: using /usr/bin/python3.8 to provide /usr/bin/python3 (python3) in auto mode

root@1f4ff0677fee:/# pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.8)      <================

root@1f4ff0677fee:/# pip3 install playwright
Collecting playwright
  Downloading https://files.pythonhosted.org/packages/b7/fd/a755971645836850765149e212ccc6a9756494ea438ac0a9efec4f5f9002/playwright-1.9.2-py3-none-manylinux1_x86_64.whl (59.1MB)
    100% |████████████████████████████████| 59.1MB 30kB/s
Collecting pyee>=8.0.1 (from playwright)
  Downloading https://files.pythonhosted.org/packages/0d/0a/933b3931107e1da186963fd9bb9bceb9a613cff034cb0fb3b0c61003f357/pyee-8.1.0-py2.py3-none-any.whl
Collecting greenlet==1.0.0 (from playwright)
  Downloading https://files.pythonhosted.org/packages/6d/59/b8e9baf19c1aaa438c1a196a007a1cc78f55877d7b860ac24e203066e911/greenlet-1.0.0-cp38-cp38-manylinux1_x86_64.whl (165kB)
    100% |████████████████████████████████| 174kB 6.2MB/s
Collecting typing-extensions (from playwright)
  Downloading https://files.pythonhosted.org/packages/60/7a/e881b5abb54db0e6e671ab088d079c57ce54e8a01a3ca443f561ccadb37e/typing_extensions-3.7.4.3-py3-none-any.whl
Installing collected packages: pyee, greenlet, typing-extensions, playwright
Successfully installed greenlet-1.0.0 playwright-1.9.2 pyee-8.1.0 typing-extensions-3.7.4.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions