Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PyCharm: Python version 2.7 does not support a 'F' prefix (even with Python 3.11)

Although I use Python 3.11, still PyCharm shows these warning messages:

Python version 2.7 does not support a 'F' prefix

and:

Python version 2.7 does not support variable annotations

What I tried

I tried to reinstall it but still the same problem. I checked the interpreter. It is Python 3.11.

OS is Windows 11 and PyCharm in latest version. I am using downgraded versions of pip, but I don't think this is the reason.

Research

I searched online but can't find the solution online.

Question

How can I avoid those warnings?

like image 208
Happy Sharma Avatar asked Dec 11 '25 22:12

Happy Sharma


1 Answers

Go to Settings > Editor > Inspections. There, in Python > Code compatibility inspections, you should see that Python 3.5's box is ticked in.(just tick the 3.6 as well)

This allows you to choose for which versions of Python your code will be inspected.

Note: this answer is originally by @Eskapps

enter image description here

like image 144
Happy Sharma Avatar answered Dec 14 '25 12:12

Happy Sharma