kholkolg / gpx_parser

8 stars 2 forks source link

Error import gpx_parser #1

Open lucadelu opened 5 years ago

lucadelu commented 5 years ago

I have an error importing the gpx_parser class

Python 3.5.3 (default, Sep 27 2018, 17:25:39) 
[GCC 6.3.0 20170516] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import gpx_parser as parser
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.5/dist-packages/gpx_parser/__init__.py", line 3, in <module>
    from gpx_parser.GPX import GPX
  File "/usr/local/lib/python3.5/dist-packages/gpx_parser/GPX.py", line 28
    self._version:Optional[str] = version
                 ^
SyntaxError: invalid syntax

thanks Luca

marian42 commented 4 years ago

It seems like the required version of Python in the readme is incorrect. It says you need Python 3.4, but you do need at least Python 3.6.

As a workaround, I got it to work with Python 3.5 by removing all type hints for local and class variables. Type hints for function parameters and return values seem to work as long as the typing package is installed.

IMO it would be best to remove type hints from this project altogether so that it works for people who use the default python installation. @kholkolg

If you have a version older than 3.6, you can also use gpxpy, which has a very similar API.

kholkolg commented 4 years ago

Hi Marian, I'm on vacation right now, almost without internet access. I'll check it next week, thanks for your feedback.

Olga Kh.

Dne út 6. 8. 2019 20:21 uživatel Marian Kleineberg notifications@github.com napsal:

It seems like the required version of Python in the readme is incorrect. It says you need Python 3.4, but you do need at least Python 3.6.

As a workaround, I got it to work with Python 3.5 by removing all type hints for local and class variables. Type hints for function parameters and return values seem to work as long as the typing package is installed.

IMO it would be best to remove type hints from this project altogether so that it works for people who use the default python installation. @kholkolg https://github.com/kholkolg

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/kholkolg/gpx_parser/issues/1?email_source=notifications&email_token=AJWNSJSDAGGOGUGUH6DCFYLQDGXKJA5CNFSM4GCW7FT2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3V3LDA#issuecomment-518763916, or mute the thread https://github.com/notifications/unsubscribe-auth/AJWNSJS5NBP3OFSTIGRPPMDQDGXKJANCNFSM4GCW7FTQ .