question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Syntax error at python 3.5

See original GitHub issue

Version 0.11.0 works fine

$ python3 --version
Python 3.5.2

Any version since 1.0.0 till latest 1.4.0 seems to be incompatible with python 3.5, but currently at pypi the required python version is specified as python=~3.5

./test.py 
Traceback (most recent call last):
  File "./test.py", line 3, in <module>
    from simple_term_menu import TerminalMenu
  File "/home/developer/.local/lib/python3.5/site-packages/simple_term_menu.py", line 566
    ):
    ^
SyntaxError: invalid syntax

test file, simply try to import:

$ cat test.py 
#!/usr/bin/env python3

from simple_term_menu import TerminalMenu

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
IngoMeyer441commented, Aug 30, 2021

Thanks at @ostanislaw and @GPMueller for pointing me to this problem. The trailing comma is indeed the problem. Before v1.0.0, no arguments were keyword-only arguments (started by *,) and a trailing comma was allowed in Python 3.5 in such parameter lists. With keyword-only arguments, a trailing comma is only allowed in Python >= 3.6 (for whatever reason, since keyword-only arguments are part of the language since Python 3.0). I removed the trailing comma, added a CI check for Python 3.5 compatibility and published a new release (v1.4.1) which should now work with Python 3.5.

0reactions
ostanislawcommented, Aug 31, 2021

Confirmed, version 1.4.1 is fixed. Thanks, that was really quick.

Read more comments on GitHub >

github_iconTop Results From Across the Web

invalid syntax on Python 3.5.2 · Issue #2541 · pypa/setuptools
I get the following error: File "xxxxxxxxxxxxxxxxxxxxxxxxxx/ve3/lib/python3.5/site-packages/setuptools/command/install_scripts.py", line 17, ...
Read more >
SyntaxError: invalid syntax - Python 3.5 - Stack Overflow
In Python 3.x input() just returns a string like raw_input() in Python 2.x. Share.
Read more >
SyntaxError: invalid syntax - Discussions on Python.org
Based on the example here, I tried to run the following code snippet but failed: run_mode, num_repeats, num_runs = 'short', 5, ...
Read more >
pip --version returns SyntaxError (invalid syntax) after installation
According to phd's post, the root cause is the PIP version installed by default being not compatible with the old Python version 3.4....
Read more >
Type hints in Python 3.5 project shown as syntax error when ...
Type hints in Python 3.5 project shown as syntax error when opening 2.7 project in another window ... I have one project with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found