hungpham2511 / toppra

robotic motion planning library
https://hungpham2511.github.io/toppra/index.html
MIT License
625 stars 170 forks source link

Invalid Syntax error #91

Closed luka3650 closed 4 years ago

luka3650 commented 4 years ago

Hello,

I have installed toppra package by the instructions and when i try to run it from the directory with : pytest -v , i always get an error like this:

ImportError while loading conftest '/home/luka29/Documents/toppra/tests/conftest.py'. tests/conftest.py:2: in import toppra toppra/init.py:10: in from .interpolator import RaveTrajectoryWrapper, SplineInterpolator,\ E File "/home/luka29/Documents/toppra/toppra/interpolator.py", line 183 E ss_waypoints: List[float] = [0.0] E ^ E SyntaxError: invalid syntax


Also i get this mistake pointed out and a few others similar like this one when i run the installation Is it possible that it has anything to do with Python versions? I have 2.7 and 3.6 installed but have put 2.7 as the default version so I don't know why that would be a problem. Hope someone can help

hungpham2511 commented 4 years ago

Hi @luka3650,

Yes, it's exactly because Python 2.7 does not support type annotation.

Please use Python3. toppra no longer support 2.7 officially.

Hint, you can use virtualenv or pyenv to select which version of python to run. For example:

https://github.com/hungpham2511/toppra/blob/24ab163c1999e04c02075919145351ae140f370e/.circleci/config.yml#L55