Skip to content
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

Error: It looks like you are using Playwright Sync API inside the asyncio loop. Please use the Async API instead. #11

Closed
harrisonham opened this issue Sep 21, 2022 · 10 comments

Comments

@harrisonham
Copy link

harrisonham commented Sep 21, 2022

Hello,
I am working on implementing the schab-api package with my trading strategy, and have gotten the error:

"Error: It looks like you are using Playwright Sync API inside the asyncio loop. Please use the Async API instead."

After some investigation, it looks like there is an issue with using the schwab-api within spyder. Is there a workaround for this? I saw that there was a way to get things to run on google colab, but the solution does not work locally for either spyder or jupyter notebook.

@hrpomrx
Copy link

hrpomrx commented Oct 29, 2022

Seeing this also, when running in Jupyter notebook.

@vstadnytskyi
Copy link

Seeing this also, when running in Jupyter notebook in Colab.

@publius001
Copy link

still seeeing this one in JupyterLab. Any workarounds?

@itsjafer
Copy link
Owner

itsjafer commented Apr 2, 2023

The only workaround I could see is using async playwright to login to Schwab since the sync_playwright library is inherently incompatible with Jupyter

@NelsonDane
Copy link
Contributor

@itsjafer could this be added with an option when creating using api = Schwab(). Like doing api = Schwab(async=True) or something like that? Can have the option default to False but be there for Jupyter or Google Colab.

@itsjafer
Copy link
Owner

itsjafer commented Dec 9, 2023

Brief update on this: I tested out an asynchronous version and it seemed to work well with Jupyter/Colab, though it wasn't actually able to login as expected. I'll continue looking into offering an async solution in the meantime.

@4rumprom
Copy link
Contributor

4rumprom commented Mar 4, 2024

I made an async login a few weeks ago that I was running on streamlit.
I'll try to see if I can retrieve it...

@publius001
Copy link

publius001 commented Mar 4, 2024 via email

@4rumprom
Copy link
Contributor

4rumprom commented Mar 4, 2024

So I found the code! I'll create a new pull request as soon as my current one for option strategies went through.

itsjafer added a commit that referenced this issue Mar 14, 2024
@itsjafer
Copy link
Owner

Hi version 0.4.0 is now compatible with asynchronous environments. Thank you @4rumprom for your contribution!

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

No branches or pull requests

7 participants