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

RuntimeError: Overloading is only supported in library stubs #30

Open
joongh opened this issue Mar 26, 2018 · 4 comments
Open

RuntimeError: Overloading is only supported in library stubs #30

joongh opened this issue Mar 26, 2018 · 4 comments
Labels

Comments

@joongh
Copy link

joongh commented Mar 26, 2018

I got an exception when I simply imported the module right after the installation of the module through pip.
Here is the whole error messages.

Python 3.5.1 (default, Jan 9 2018, 22:10:30)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import prices
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/joong/.pyenv/versions/test_pot/lib/python3.5/site-packages/prices/__init__.py", line 6, in <module>
from .discount import (
File "/Users/joong/.pyenv/versions/test_pot/lib/python3.5/site-packages/prices/discount.py", line 4, in <module>
from .money import Money
File "/Users/joong/.pyenv/versions/test_pot/lib/python3.5/site-packages/prices/money.py", line 12, in <module>
class Money:
File "/Users/joong/.pyenv/versions/test_pot/lib/python3.5/site-packages/prices/money.py", line 61, in Money
def __truediv__(self, other: 'Money') -> Decimal:
File "/Users/joong/.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
>>> ^D

@patrys
Copy link
Contributor

patrys commented Mar 26, 2018

Could you try installing the latest typing library from PyPI?

@joongh
Copy link
Author

joongh commented Mar 26, 2018

Here is the modules installed on my environment.

joong$ pip freeze
Babel==2.5.3
prices==1.0.0
pytz==2018.3
typing==3.6.4

@patrys
Copy link
Contributor

patrys commented Mar 26, 2018

I see, typing==3.6.4 has no effect in Python 3.5 which still falls back to the builtin typing==3.5.x that does not support overloading in Python code. As a workaround I suggest upgrading to Python 3.6 but we may be forced to find a better fix for the long run.

@patrys patrys added the bug label Mar 26, 2018
@joongh
Copy link
Author

joongh commented Mar 26, 2018

OK, I understood. I hope you fix it soon.
Thank you for your quick response.

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

No branches or pull requests

2 participants