bunq / tinker_python

Install Tinker by just running this command: bash <(curl -s https://tinker.bunq.com/python/setup.sh)
MIT License
15 stars 7 forks source link

Not able to run! #32

Open blackspeck opened 3 years ago

blackspeck commented 3 years ago

Im not able to run user_overview.py I get this error message

File "tinker/user_overview.py“, line 2, in <module>
    from libs.bunq_lib import BunqLib
  File "/bunqtink/tinker/libs/bunq_lib.py", line 8, in <module>
    from bunq.sdk.client import Pagination
  File "/bunqtink/.venv/lib/python3.6/site-packages/bunq/__init__.py", line 6, in <module>
    from bunq.sdk.json import converter
  File "/bunqtink/.venv/lib/python3.6/site-packages/bunq/sdk/json/converter.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined
schluchter commented 3 years ago

I have encountered the same problem. When I go into converter.py and remove the offending import line from __future__ import annotations, the file can still be run.

However, I then get an error of Traceback (most recent call last): File "tinker/user_overview.py", line 2, in <module> from libs.bunq_lib import BunqLib File "/Users/Leiter/Developer/bunq-tinker/tinker/libs/bunq_lib.py", line 8, in <module> from bunq.sdk.client import Pagination File "/Users/Leiter/.local/share/virtualenvs/bunq-tinker-MGcC4iM-/lib/python3.6/site-packages/bunq/__init__.py", line 6, in <module> from bunq.sdk.json import converter File "/Users/Leiter/.local/share/virtualenvs/bunq-tinker-MGcC4iM-/lib/python3.6/site-packages/bunq/sdk/json/converter.py", line 22, in <module> class JsonAdapter(Generic[T]): File "/Users/Leiter/.local/share/virtualenvs/bunq-tinker-MGcC4iM-/lib/python3.6/site-packages/bunq/sdk/json/converter.py", line 67, in JsonAdapter adapter: Type[JsonAdapter]) -> None: NameError: name 'JsonAdapter' is not defined

fleaz commented 3 years ago

Hey,

it looks like both of you are using Python 3.6 in the virtualenvs. According to PEP-563, annotations is only available since Python 3.7 therefore the import is failing in your environments.

schluchter commented 3 years ago

@fleaz Yes, that's definitely it. The Pipfile specifies 3.6 as a requirement. Bumping up the version in the Pipfile should fix this.