playwright-python
playwright-python copied to clipboard
[BUG] Can't install Playwright with Conda on M1 Mac
Context:
- Playwright Version:
v1.30
- Operating System:
MacOS Ventura 13.1
- Python version:
3.9
- Extra:
conda 22.11.1
Code Snippet
% conda create -n test_playwright python=3.9
% conda activate test_playwright
% conda install -c microsoft playwright
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
Looks like it found conflicts but it's not able to list them. I'm not a conda expert, so would appreciate if you could dig a bit - maybe some log files somewhere will give us more hints or enabling a verbose mode.
Let me try on my macOS in a bit.
I tried it on my M1 mac with miniconda Intel where it was working without any issues. If you have miniconda for Apple M1 Silicon Chip, then its indeed not working.
I tried it on my M1 mac with miniconda Intel where it was working without any issues. If you have miniconda for Apple M1 Silicon Chip, then its indeed not working.
I do have an Apple M1 pro Silicon Chip...
what are the workarounds for this (if any)?
You can install miniconda Intel instead as a workaround. Maybe you can also override the arch which conda is installing.
is direct support for M1 Silicon Chip in the works? when will it be available?
In the meantime I will try what @mxschmitt suggested. I found the following 2 resources that might help me with the workaround:
I have tried to install playwright with miniconda intel based on the above instructions and tried to install playwright but am still getting the same error:
(playwright_39_x86) ~ % uname -m
x86_64
(playwright_39_x86) ~ % conda list
# packages in environment at /Users/mburki/miniconda3-intel/envs/playwright_39_x86:
#
# Name Version Build Channel
ca-certificates 2023.01.10 hecd8cb5_0
certifi 2022.12.7 py39hecd8cb5_0
libcxx 14.0.6 h9765a3e_0
libffi 3.4.2 hecd8cb5_6
ncurses 6.4 hcec6c5f_0
openssl 1.1.1s hca72f7f_0
pip 22.3.1 py39hecd8cb5_0
python 3.9.16 h218abb5_0
readline 8.2 hca72f7f_0
setuptools 65.6.3 py39hecd8cb5_0
sqlite 3.40.1 h880c91c_0
tk 8.6.12 h5d9f67b_0
tzdata 2022g h04d1e81_0
wheel 0.37.1 pyhd3eb1b0_0
xz 5.2.10 h6c40b1e_1
zlib 1.2.13 h4dc903c_0
(playwright_39_x86) ~ % conda install -c microsoft playwright
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: /
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found to be incompatible with each other:
Output in format: Requested package -> Available versions
What am I missing?
Since not a lot of people are using conda with Playwright, and from my research an Apple Silicon Mac is required to publish to conda when you want to provide M1 conda builds, it most likely does not happen in the near future. We recommend using PIP for now, which has Apple Silicon support with Playwright.
The error unfortunately does not say much what's going wrong.
On Apple Silicon it seems there is a conflict with the greenlet version requirements. Playwright requires greenlet==2.0.1, but I can only install greenlet v.2.0.2 using pip. Installation from git installs correctly.
Installed 1.36 with pip and there was no conflict with greenlet==2.02.
Successfully installed greenlet-2.0.2 playwright-1.36.0
pip installs arm64 version - Downloading playwright-1.36.0-py3-none-macosx_11_0_arm64.whl
. Said that, conda support would be nice.
I've installed playwright into base env, but on playwright launch script is just stops with no error log
from my research an Apple Silicon Mac is required to publish to conda when you want to provide M1 conda builds
This is not correct. You can specify the target platform in conda-build and create cross-platform builds. Conda-forge is actually doing exactly this for all their M1 packages.
This should be fixed as part of v1.43.0