Large amount of errors installing `python-playwright-git`

The error message after failure is huge so I posted it on pastebin (if that’s ok).

The relevant error message probably:

% Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                               Dload  Upload   Total   Spent    Left  Speed
  100 19.0M  100 19.0M    0     0   333k      0  0:00:58  0:00:58 --:--:--  361k
  Fetching  https://playwright.azureedge.net/builds/driver/next/playwright-1.11.0-next-1620085974000-linux.zip
  Traceback (most recent call last):
File "/home/moss/miniconda3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 280, in <module>
  main()
File "/home/moss/miniconda3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 263, in main
  json_out['return_val'] = hook(**hook_input['kwargs'])
File "/home/moss/miniconda3/lib/python3.8/site-packages/pip/_vendor/pep517/_in_process.py", line 204, in build_wheel
  return _build_backend().build_wheel(wheel_directory, config_settings,
File "/tmp/pip-build-env-vpxu1rpd/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 221, in build_wheel
  return self._build_with_temp_dir(['bdist_wheel'], '.whl',
File "/tmp/pip-build-env-vpxu1rpd/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 207, in _build_with_temp_dir
  self.run_setup()
File "/tmp/pip-build-env-vpxu1rpd/overlay/lib/python3.8/site-packages/setuptools/build_meta.py", line 150, in run_setup
  exec(compile(code, __file__, 'exec'), locals())
File "setup.py", line 133, in <module>
  setup(
File "/tmp/pip-build-env-vpxu1rpd/overlay/lib/python3.8/site-packages/setuptools/__init__.py", line 153, in setup
  return distutils.core.setup(**attrs)
File "/home/moss/miniconda3/lib/python3.8/distutils/core.py", line 148, in setup
  dist.run_commands()
File "/home/moss/miniconda3/lib/python3.8/distutils/dist.py", line 966, in run_commands
  self.run_command(cmd)
File "/home/moss/miniconda3/lib/python3.8/distutils/dist.py", line 985, in run_command
  cmd_obj.run()
File "setup.py", line 120, in run
  with InWheel(
  TypeError: __init__() got an unexpected keyword argument 'ret_self'

  ----------------------------------------

  ERROR: Failed building wheel for playwright
Failed to build playwright
ERROR: Could not build wheels for playwright which use PEP 517 and cannot be installed directly
==> ERROR: A failure occurred in package().
Aborting...
error making: python-playwright-git

What I am trying to do:

I am trying to run a python script that requires playwright. If I install it using pip, when running, it complains a shared library, libicui18n.so.66, is not found.

$ yay -F libicui18n.so
core/icu 68.2-1 [installed: 69.1-1]
    usr/lib/libicui18n.so
community/onlyoffice-desktopeditors 6.1.0-4
    opt/onlyoffice/desktopeditors/libicui18n.so
community/synology-drive-client 2.0.3.11102-1
    opt/Synology/SynologyDrive/lib/libicui18n.so
multilib/lib32-icu 68.2-1 [installed: 69.1-1]
    usr/lib32/libicui18n.so
alerque/zoom-system-qt 5.4.53391.1108-3
    opt/zoom/libicui18n.so

So I am guessing I need to build playwrght myself. That is why I am trying to install python-playwright-git.

You’re trying to install with yay which installs the package system-wide. However, in your log, you’re using your user’s miniconda installation.

Instead of a global installation, I recommend using a virtualenv based on the system’s Python installation (and not miniconda) or pyenv and then you can easily run pip install playwright.

1 Like

I tried using virtualenv resulting in the same error:

$ virtualenv -p python3 tu
$ cd tu
$ source bin/activate
$ pip install playwright
$ python -m playwright install

When I run the script I still get this error:

==================== Browser output: ====================
<launching> /home/moss/.cache/ms-playwright/webkit-1446/pw_run.sh --inspector-pipe --headless --no-startup-window
<launched> pid=7161
[pid=7161][err] /home/moss/.cache/ms-playwright/webkit-1446/minibrowser-wpe/bin/MiniBrowser: error while loading shared libraries: libicui18n.so.66: cannot open shared object file: No such file or directory
=========================== logs ===========================
<launching> /home/moss/.cache/ms-playwright/webkit-1446/pw_run.sh --inspector-pipe --headless --no-startup-window
<launched> pid=7161
[pid=7161][err] /home/moss/.cache/ms-playwright/webkit-1446/minibrowser-wpe/bin/MiniBrowser: error while loading shared libraries: libicui18n.so.66: cannot open shared object file: No such file or directory
============================================================

What am I doing wrong?