gelpia icon indicating copy to clipboard operation
gelpia copied to clipboard

Invalid syntax error while using Gelpia for the first time

Open rosaAbbasi opened this issue 4 years ago • 1 comments

I get a invalid syntax error using gelpia for the first time after installation.

  • I installed Gelpia for using "make requirements" and then "make".
  • Afterwards I ran this command: "./bin/gelpia --function "x=[1,10]; y=[5,15]; x^2 + x*y" " and I got an exception that the "sly" module was not installed.
  • Then I installed "sly" and after that I got the "SyntaxError: invalid syntax" error.

Here is the log:

./bin/gelpia --function "x=[1,10]; y=[5,15]; x^2 + x*y" Traceback (most recent call last): File "gelpia/gelpia/bin/function_to_lexed.py", line 16, in from sly import Lexer File ".local/lib/python3.5/site-packages/sly/init.py", line 2, in from .lex import * File "/.local/lib/python3.5/site-packages/sly/lex.py", line 78 return f'Token(type={self.type!r}, value={self.value!r}, lineno={self.lineno}, index={self.index})' ^ SyntaxError: invalid syntax

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./bin/gelpia", line 7, in from process_function import process_function File "gelpia/gelpia/bin/process_function.py", line 6, in from pass_utils import extract_exp_from_diff File "gelpia/gelpia/bin/pass_utils.py", line 5, in import function_to_lexed File "gelpia/gelpia/bin/function_to_lexed.py", line 17, in except ModuleNotFoundError: NameError: name 'ModuleNotFoundError' is not defined

rosaAbbasi avatar Oct 06 '20 08:10 rosaAbbasi

Hello @rosaAbbasi,

Thanks for the report. This error occurred because sly uses f-strings which is a new feature in Python 3.6, however it appears based on your site-packages that you are using Python 3.5.

I will update the requirements to state that Python 3.6+ is required.

Thanks, Mark

keram88 avatar Feb 06 '21 04:02 keram88