Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

[Bug]: playwright install is broken when installing 1.51.0 from microsoft conda channel #2791

Closed
cisaacstern opened this issue Mar 18, 2025 · 5 comments · Fixed by #2792
Closed

Comments

@cisaacstern
Copy link
Contributor

cisaacstern commented Mar 18, 2025

Version

1.51.0

Steps to reproduce

I personally prefer to use pixi, but have verified the behavior is consistent on other conda-compatible environment managers, e.g. micromamba.

Example steps

  1. Install pixi https://pixi.sh/latest/#installation
  2. In an empty directory, run:
$ pixi init
$ pixi project channel add --prepend microsoft
$ pixi add microsoft:playwright
  1. The pixi.toml manifest file now reads:
$ cat pixi.toml
[project]
authors = ["Charles Stern <62192187+cisaacstern@users.noreply.github.com>"]
channels = ["microsoft", "conda-forge"]
name = "scratch"
platforms = ["osx-arm64"]
version = "0.1.0"

[tasks]

[dependencies]
playwright = ">=1.51.0,<2"
  1. The playwright python package is importable without error
$ pixi run python3 -c "import playwright"
  1. But playwright install is not runnable, throwing:
$  pixi run playwright install
Traceback (most recent call last):
  File "/scratch/.pixi/envs/default/bin/playwright", line 10, in <module>
    sys.exit(main())
             ~~~~^^
  File "/scratch/.pixi/envs/default/lib/python3.13/site-packages/playwright/__main__.py", line 24, in main
    completed_process = subprocess.run(
        [driver_executable, driver_cli, *sys.argv[1:]], env=get_driver_env()
    )
  File "/scratch/.pixi/envs/default/lib/python3.13/subprocess.py", line 556, in run
    with Popen(*popenargs, **kwargs) as process:
         ~~~~~^^^^^^^^^^^^^^^^^^^^^^
  File "/scratch/.pixi/envs/default/lib/python3.13/subprocess.py", line 1038, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
    ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
                        pass_fds, cwd, env,
                        ^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
                        gid, gids, uid, umask,
                        ^^^^^^^^^^^^^^^^^^^^^^
                        start_new_session, process_group)
                        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/scratch/.pixi/envs/default/lib/python3.13/subprocess.py", line 1974, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: '/scratch/.pixi/envs/default/lib/python3.13/site-packages/playwright/driver/node'
  1. Downgrading to <1.51.0...
$ pixi add "microsoft:playwright<1.51.0"
$ cat pixi.toml
[project]
authors = ["Charles Stern <62192187+cisaacstern@users.noreply.github.com>"]
channels = ["microsoft", "conda-forge"]
name = "scratch"
platforms = ["osx-arm64"]
version = "0.1.0"

[tasks]

[dependencies]
playwright = "<1.51.0"
  1. ...resolves this issue, allowing us to run the following command without error
$ pixi run playwright install

Expected behavior

I would expect playwright install to be runnable without error when installing the latest playwright via the microsoft conda channel.

Actual behavior

playwright install is not runnable for the latest release on the microsoft conda channel, seemingly due to a lack of packaging the nodejs dependency.

Additional context

One possibility to protect against regressions on the fix might be to include playwright install in the test commands here:

commands:
- playwright --help

I am happy to contribute a fix if someone can point me in the right direction. TBH, it's a little confusing to me why this might be the case, given that the meta.yaml recipe does not seem to have changed too recently.

Thank you all for your support, I love working with playwright!

Environment

- Operating System: [Sonoma 14.4.1]
- CPU: [arm64]
- Browser: [All]
- Python Version: [3.13.2]
- Other info:
@mxschmitt
Copy link
Member

Thanks for filing the issue, looking at the diff (v1.50.0...v1.51.0) its probably caused by #2741.

I think we should remove noarch and change

to 3.9 - this should fix it, wdyt?

@cisaacstern
Copy link
Contributor Author

@mxschmitt thanks for the prompt reply!

That seems like one possible solution, though certainly noarch is desirable if it can be achieved.

Wdyt about keeping noarch, and adding nodejs as a dependency in the conda meta.yaml?

And apart from the specific fix, does it seem appropriate to possibly:

  • Add the playwright install to the meta.yaml test commands
  • Add an on: pull_request trigger to the publish.yaml workflow, and when we run in this context, to disable
    conda config --set anaconda_upload yes

This way, we can be sure that PRs don't break playwright install (or anything else about the conda build) going forward?

@cisaacstern
Copy link
Contributor Author

Wdyt about keeping noarch, and adding nodejs as a dependency in the conda meta.yaml?

I suppose I should clarify, is the following missing package somehow related to missing nodejs in the environment, do you know?

python3.13/site-packages/playwright/driver/node

@mxschmitt
Copy link
Member

mxschmitt commented Mar 18, 2025

That seems like one possible solution, though certainly noarch is desirable if it can be achieved.

FYI: The only reason for os specific conda's is because of Node.js.

We have some conda build tests which should probably already yield the problem if we add playwright install to the test commands. Might be good to run a simple playwright script there as well I think, this would help us to not break it in the future.

Wdyt about keeping noarch, and adding nodejs as a dependency in the conda meta.yaml?

If we can easily achieve this, happy to do that but I think better to restore status quo for now. We can potentially follow-up on it. While it sounds good on the first hand it also means that Python/conda is the only language port which doesn't use Playwrights Node.js version. Would have to consult with the team for it first and it probably means we need to add some 'ifs' somewhere in the code to locate it.

Do you want to add the test commands and fix it or should I go ahead? I would do it tomorrow then.

@cisaacstern
Copy link
Contributor Author

I think better to restore status quo for now.

Makes total sense!

I've put a PR up for your review here #2792 🙏

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants