petercorke/robotics-toolbox-python

TypeError: Plain typing_extensions.Self is not valid as type argument on Import

Ptisni opened this issue · 0 comments

Ptisni commented

Describe the bug
Import of roboticstoolbox fails with the error message below.

Version information

Did you install from PyPI or GitHub? PyPI
If PyPI what version number? 1.1.0

To Reproduce
Steps to reproduce the behavior:
pip install roboticstoolbox-python ipython3 import roboticstoolbox
2. The script output, including error messages.

Traceback (most recent call last):
File "Controllers.py", line 1, in
import roboticstoolbox as rtb
File "/home/peter/.local/lib/python3.8/site-packages/roboticstoolbox/init.py", line 3, in
from roboticstoolbox.robot import *
File "/home/peter/.local/lib/python3.8/site-packages/roboticstoolbox/robot/init.py", line 1, in
from roboticstoolbox.robot.Robot import BaseRobot, Robot, Robot2
File "/home/peter/.local/lib/python3.8/site-packages/roboticstoolbox/robot/Robot.py", line 45, in
from roboticstoolbox.robot.BaseRobot import BaseRobot
File "/home/peter/.local/lib/python3.8/site-packages/roboticstoolbox/robot/BaseRobot.py", line 43, in
from roboticstoolbox.robot.Gripper import Gripper
File "/home/peter/.local/lib/python3.8/site-packages/roboticstoolbox/robot/Gripper.py", line 10, in
from roboticstoolbox.robot.Link import Link
File "/home/peter/.local/lib/python3.8/site-packages/roboticstoolbox/robot/Link.py", line 62, in
class BaseLink(SceneNode, ABC):
File "/home/peter/.local/lib/python3.8/site-packages/roboticstoolbox/robot/Link.py", line 128, in BaseLink
parent: Union[Self, str, None] = None,
File "/usr/lib/python3.8/typing.py", line 261, in inner
return func(*args, **kwds)
File "/usr/lib/python3.8/typing.py", line 358, in getitem
parameters = tuple(_type_check(p, msg) for p in parameters)
File "/usr/lib/python3.8/typing.py", line 358, in
parameters = tuple(_type_check(p, msg) for p in parameters)
File "/usr/lib/python3.8/typing.py", line 145, in _type_check
raise TypeError(f"Plain {arg} is not valid as type argument")
TypeError: Plain typing_extensions.Self is not valid as type argument

Environment (please complete the following information):

  • Your OS (MacOS, Linux, Windows): Ubuntu 20.04
  • Your Python version: 3.8.10

Additional context