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

Error import gpx_parser #1

Open
lucadelu opened this issue Nov 9, 2018 · 2 comments
Open

Error import gpx_parser #1

lucadelu opened this issue Nov 9, 2018 · 2 comments

Comments

@lucadelu
Copy link

lucadelu commented Nov 9, 2018

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
Copy link

marian42 commented Aug 6, 2019

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
Copy link
Owner

kholkolg commented Aug 9, 2019 via email

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

No branches or pull requests

3 participants