cs50/python-cs50

Syntax error during import

abendplays opened this issue · 2 comments

Hey guys,
first of all: thank you so much for offering the cs50 course! It has really helped me understand how a "computer thinks". :)
I also wanted to thank you for maintaining the cs50 python library.
For my final project -which I decided to code on my own computer- I installed the cs50 library especially for the db execute commands.

However, when I try import it into a python project, I get the following SyntaxError:

Traceback (most recent call last): File "facial_rec.py", line 5, in <module> import cs50 File "/usr/local/lib/python3.5/dist-packages/cs50/__init__.py", line 20, in <module> from .sql import SQL File "/usr/local/lib/python3.5/dist-packages/cs50/sql.py", line 404 return sqlparse.sql.Token(sqlparse.tokens.Other, f"x'{value.hex()}'") # https://dev.mysql.com/doc/refman/8.0/en/hexadecimal-literals.html ^ SyntaxError: invalid syntax

I'm running Ubuntu 16.04 (fully updated) in a VM. For coding I use pycharm with Python 3.5 as the interpreter.
Do you guys have any suggestion on how to tackle the problem?

Cheers and stay healthy!

Any thoughts?

Hi @abendplays, you're very welcome!

CS50 assumes Python >= 3.6 (for f-strings, in this case)!