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

Importing chainer fails on Python 3.5.1 #5959

Closed
okapies opened this issue Jan 8, 2019 · 0 comments · Fixed by #5960
Closed

Importing chainer fails on Python 3.5.1 #5959

okapies opened this issue Jan 8, 2019 · 0 comments · Fixed by #5960

Comments

@okapies
Copy link
Member

okapies commented Jan 8, 2019

This is a bug reported by @hvy. When importing the current master version of chainer (070deb5) on Python 3.5.1, it fails with RuntimeError because it uses the older builtin typing module which doesn't support @overload annotation outside a stub file.

$ python
Python 3.5.1 (default, Nov 15 2018, 17:50:51) 
[GCC 5.5.0 20171010] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import chainer
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/user/chainer/chainer/__init__.py", line 18, in <module>
    from chainer import links  # NOQA
  File "/home/user/chainer/chainer/links/__init__.py", line 3, in <module>
    from chainer.links.activation.maxout import Maxout  # NOQA
  File "/home/user/chainer/chainer/links/activation/maxout.py", line 6, in <module>
    from chainer import link
  File "/home/user/chainer/chainer/link.py", line 1144, in <module>
    class ChainList(Link, collections_abc.MutableSequence):
  File "/home/user/chainer/chainer/link.py", line 1182, in ChainList
    @tp.overload  # NOQA
  File "/home/user/.pyenv/versions/3.5.1/lib/python3.5/typing.py", line 1184, in overload
    raise RuntimeError("Overloading is only supported in library stubs")
RuntimeError: Overloading is only supported in library stubs
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

Successfully merging a pull request may close this issue.

1 participant