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

ImportError: cannot import name 'AsyncGenerator' #530

Closed
jerod-estapa opened this issue Jan 23, 2018 · 2 comments
Closed

ImportError: cannot import name 'AsyncGenerator' #530

jerod-estapa opened this issue Jan 23, 2018 · 2 comments

Comments

@jerod-estapa
Copy link

I may be missing something embarrassingly obvious here, but I'm getting a consistent import error for AsyncGenerator using 3.6.0. All other imports are working fine, as far as I can tell.

It's listed among the group of imports that are only added if their non-generic counterparts are not in stdlib:

# The following are added depending on presence # of their non-generic counterparts in stdlib: # Awaitable, # AsyncIterator, # AsyncIterable, # Coroutine, # Collection, # AsyncGenerator, # AsyncContextManager

Is this possibly a local issue?

@JelleZijlstra
Copy link
Member

In 3.6.0, you will get the version of typing that was bundled with 3.6.0, not the latest version maintained in this repo. I haven't checked, but I think we missed AsyncGenerator initially and added it later in the 3.6 series.

Two possible workarounds:

  • Upgrade to a later version of 3.6
  • Use if TYPE_CHECKING: from typing import AsyncGenerator

@jerod-estapa
Copy link
Author

Awesome, thanks.

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

2 participants