Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid syntax error while using Gelpia for the first time #32

Open
rosaAbbasi opened this issue Oct 6, 2020 · 1 comment
Open

Invalid syntax error while using Gelpia for the first time #32

rosaAbbasi opened this issue Oct 6, 2020 · 1 comment

Comments

@rosaAbbasi
Copy link

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

@keram88
Copy link
Member

keram88 commented Feb 6, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants