This thread is trying to answer question "How can I resolve the installation issues with Python and its related packages, specifically 'greenlet' and 'playwright'?"
so
Then to make sure pytest is actually installed correctly.
Try pip install msvc-runtime See https://github.com/microsoft/playwright-python/issues/1720.
well, it cleared up some stuff __________________________________________ ERROR collecting test_my_application.py ___________________________________________ ImportError while importing test module 'C:\Users\bdixon\AppData\Local\Microsoft\WindowsApps\Python\test_my_application.py'. Hint: make sure your test modules/packages have valid Python names. Traceback: ......\Programs\Python\Python311\Lib\importlib_init_.py:126: in import_module return _bootstrap.gcd_import(name[level:], package, level) test_my_application.py:2: in <module> from playwright.sync_api import Page, expect ..........\venv\Lib\site-packages\playwright\sync_api_init.py:25: in <module> import playwright.sync_api._generated ..........\venv\Lib\site-packages\playwright\sync_api_generated.py:25: in <module> from playwright._impl._accessibility import Accessibility as AccessibilityImpl ..........\venv\Lib\site-packages\playwright_impl_accessibility.py:17: in <module> from playwright._impl.connection import Channel ..........\venv\Lib\site-packages\playwright_impl_connection.py:34: in <module> from greenlet import greenlet ..........\venv\Lib\site-packages\greenlet_init.py:29: in <module> from ._greenlet import _C_API # pylint:disable=no-name-in-module E ImportError: DLL load failed while importing _greenlet: The specified module could not be found.
So use this to build the fixtures you want instead of using pre-defined fixtures from pytest-playwright
How I got to my level of brokeness
solution found!
I was missing some libraries
Thanks for letting us know! I wrote a comment in the GitHub issue about it: https://github.com/microsoft/playwright-python/issues/1720#issuecomment-1574332805
Hi, I am new here I am on macOS Ventura, latest 3.11 Python, pip, pytest and Pycharm.
Followed standard installation methods, playwright 1.35 is visible with the drivers, but before I try to run the first helloworld test , I am getting error: from playwright.sync_api import Page, expect - here for playwright getting this: "Package containing module 'playwright' is not listed in the project requirements"
I have already re-run pip install -r requirements.txt, but does not add playwright to the requirements. What am I missing?
Rayrun is a community for QA engineers. I am constantly looking for new ways to add value to people learning Playwright and other browser automation frameworks. If you have feedback, email [email protected].