Home > Net >  Invalid syntax match, Python
Invalid syntax match, Python

Time:04-15

I just started using Linux a couple days ago, I had the script running fine but made a lot of changes today

I tried to run the script using

python3 ds_main.py

which returns the error:

Traceback (most recent call last):
  File "ds_main.py", line 14 in <module>
    import cmd_main
  File "/home/me/discord/cmd_main.py", line 190
    match action:
          ^
SyntaxError: invalid syntax

In this section I did add a match case clause, which the error seems to be pointing to?

I checked the version using python3 --version which returns Python 3.8.10

Not sure what else!

CodePudding user response:

Python 3.8.10 does not support structural pattern matching (match keyword). You need Python >= 3.10.x

https://peps.python.org/pep-0634/

  • Related