I just installed django and after installing that I created a django project and was trying to run django server by command:
python manage.py runserver
After that I'am getting error as: SyntaxError: Generator expression must be parenthesized
GenExpr is the internal language used by gen patchers. It is used to describe computations in an implementation agnostic manner. To perform actual computations, it is translated into machine code for the CPU or GPU by the various Gen objects ( gen~ , jit. gen , etc.).
Generators have been an important part of Python ever since they were introduced with PEP 255. Generator functions allow you to declare a function that behaves like an iterator. They allow programmers to make an iterator in a fast, easy, and clean way.
List comprehensions are usually faster than generator expressions as generator expressions create another layer of overhead to store references for the iterator. However, the performance difference is often quite small.
TL; DR: Upgrade Django to version 1.11.17+ or 2.0+
This error is a known incompatibility related to Python issue #32012. Projects based on Django 1.11.16 and below will raise this exception when started with Python 3.7. A patch for this issue has been merged into Django 2.0 and 2.1 branches and cherry-picked later into Django 1.11.17.
Note: Python 3.7 is officially supported by Django 1.11.17 and above, including any 2.x branch.
Generator expression must be parenthesized
> Update Django version to 1.11.17
pip install django==1.11.17
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With