Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

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

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

Already on GitHub? Sign in to your account

web_voyager.ipynb met with a "NotImplementedError" when i run the example script #431

Closed
4 tasks done
chuangzhidan opened this issue May 11, 2024 · 1 comment
Closed
4 tasks done

Comments

@chuangzhidan
Copy link

chuangzhidan commented May 11, 2024

Checked other resources

  • I added a very descriptive title to this issue.
  • I searched the LangChain documentation with the integrated search.
  • I used the GitHub search to find a similar question and didn't find it.
  • I am sure that this is a bug in LangChain rather than my code.

Example Code

**exactly the same code in the web_voyager.ipynb

Error Message and Stack Trace (if applicable)

---------------------------------------------------------------------------
NotImplementedError                       Traceback (most recent call last)
Cell In[10], line 5
      2 from IPython import display
      3 from playwright.async_api import async_playwright
----> 5 browser = await async_playwright().start()
      7 # We will set headless=False so we can watch the agent navigate the web.
      8 browser = await browser.chromium.launch(headless=False, args=None)

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\async_api\_context_manager.py:51, in PlaywrightContextManager.start(self)
     50 async def start(self) -> AsyncPlaywright:
---> 51     return await self.__aenter__()

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\async_api\_context_manager.py:46, in PlaywrightContextManager.__aenter__(self)
     44 if not playwright_future.done():
     45     playwright_future.cancel()
---> 46 playwright = AsyncPlaywright(next(iter(done)).result())
     47 playwright.stop = self.__aexit__  # type: ignore
     48 return playwright

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_connection.py:272, in Connection.run(self)
    269 async def init() -> None:
    270     self.playwright_future.set_result(await self._root_object.initialize())
--> 272 await self._transport.connect()
    273 self._init_task = self._loop.create_task(init())
    274 await self._transport.run()

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_transport.py:133, in PipeTransport.connect(self)
    131 except Exception as exc:
    132     self.on_error_future.set_exception(exc)
--> 133     raise exc
    135 self._output = self._proc.stdin

File ~\AppData\Local\Programs\Python\Python39\lib\site-packages\playwright\_impl\_transport.py:120, in PipeTransport.connect(self)
    117         startupinfo.wShowWindow = subprocess.SW_HIDE
    119     executable_path, entrypoint_path = compute_driver_executable()
--> 120     self._proc = await asyncio.create_subprocess_exec(
    121         executable_path,
    122         entrypoint_path,
    123         "run-driver",
    124         stdin=asyncio.subprocess.PIPE,
    125         stdout=asyncio.subprocess.PIPE,
    126         stderr=_get_stderr_fileno(),
    127         limit=32768,
    128         env=env,
    129         startupinfo=startupinfo,
    130     )
    131 except Exception as exc:
    132     self.on_error_future.set_exception(exc)

File ~\AppData\Local\Programs\Python\Python39\lib\asyncio\subprocess.py:236, in create_subprocess_exec(program, stdin, stdout, stderr, loop, limit, *args, **kwds)
    229     warnings.warn("The loop argument is deprecated since Python 3.8 "
    230                   "and scheduled for removal in Python 3.10.",
    231                   DeprecationWarning,
    232                   stacklevel=2
    233     )
    234 protocol_factory = lambda: SubprocessStreamProtocol(limit=limit,
    235                                                     loop=loop)
--> 236 transport, protocol = await loop.subprocess_exec(
    237     protocol_factory,
    238     program, *args,
    239     stdin=stdin, stdout=stdout,
    240     stderr=stderr, **kwds)
    241 return Process(transport, protocol, loop)

File ~\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py:1676, in BaseEventLoop.subprocess_exec(self, protocol_factory, program, stdin, stdout, stderr, universal_newlines, shell, bufsize, encoding, errors, text, *args, **kwargs)
   1674     debug_log = f'execute program {program!r}'
   1675     self._log_subprocess(debug_log, stdin, stdout, stderr)
-> 1676 transport = await self._make_subprocess_transport(
   1677     protocol, popen_args, False, stdin, stdout, stderr,
   1678     bufsize, **kwargs)
   1679 if self._debug and debug_log is not None:
   1680     logger.info('%s: %r', debug_log, transport)

File ~\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py:498, in BaseEventLoop._make_subprocess_transport(self, protocol, args, shell, stdin, stdout, stderr, bufsize, extra, **kwargs)
    494 async def _make_subprocess_transport(self, protocol, args, shell,
    495                                      stdin, stdout, stderr, bufsize,
    496                                      extra=None, **kwargs):
    497     """Create subprocess transport."""
--> 498     raise NotImplementedError

NotImplementedError: 

Description

i restarted the kernel to use updated packages. search the internet, did not find a solution

playwright Version: 1.43.0
Summary: A high-level API to automate web browsers
Home-page: https://github.com/Microsoft/playwright-python
Author: Microsoft Corporation
Author-email:
License: Apache-2.0
Location: c:\users\gavin\appdata\local\programs\python**\python39**lib\site-packages
Requires: greenlet, pyee
Required-by:

System Info

langchain==0.1.17
langchain-community==0.0.37
langchain-core==0.1.52
langchain-openai==0.1.1
langchain-text-splitters==0.0.1
langchainhub==0.1.15
langgraph==0.0.45
langsmith==0.1.54

@hinthornw
Copy link
Contributor

This is a playwright issue so I"m going to move this to discussions. THere are other threads related to playwright and asyncio breaks on windows, e.g.: microsoft/playwright-python#723

@langchain-ai langchain-ai locked and limited conversation to collaborators May 15, 2024
@hinthornw hinthornw converted this issue into discussion #465 May 15, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants