mirumee / prices

Python price handling for humans.
Other
268 stars 39 forks source link

RuntimeError: Overloading is only supported in library stubs #30

Open joongh opened 6 years ago

joongh commented 6 years ago

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 commented 6 years ago

Could you try installing the latest typing library from PyPI?

joongh commented 6 years ago

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 commented 6 years ago

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.

joongh commented 6 years ago

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