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

Fail to import typing at python 3.7 runtime #1050

Closed
sean-ahn opened this issue Jan 21, 2019 · 1 comment

Comments

Projects
None yet
2 participants
@sean-ahn
Copy link
Contributor

commented Jan 21, 2019

Problem

chalice fails when trying to import a typing module at python 3.7 runtime.

CloudWatch Logs

[ERROR] AttributeError: type object 'Callable' has no attribute '_abc_registry'
Traceback (most recent call last):
  File "/var/lang/lib/python3.7/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/var/lang/lib/python3.7/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 696, in _load
  File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 728, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/var/task/app.py", line 4, in <module>
    from typing import Optional
  File "/var/task/typing.py", line 1347, in <module>
    class Callable(extra=collections_abc.Callable, metaclass=CallableMeta):
  File "/var/task/typing.py", line 1003, in __new__
    self._abc_registry = extra._abc_registry

Reason

This issue is known to occur when importing a backport instead of the stdlib typing module in python 3.7. (Reference: python typing module)

typing is in the standard library since 3.5.

Suggestion

Ignore typing at install_requires when python_version is 3.7 (or both of 3.7 and 3.6).

(References: alexa-skills-kit-sdk-for-python, zulip-terminal)

@stealthycoin

This comment has been minimized.

Copy link
Contributor

commented Jan 28, 2019

Closing since the PR was merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.