I would like to use python3 syntax in PyCharm 2016.2 and have configured the interpreter to use python3.5. The code runs fine when I execute it but PyCharm complains about python3 syntax that isn't supported in python2.
How can I convince PyCharm that the python3 syntax is ok?
Do one of the following: Click the Python Interpreter selector and choose Add Interpreter. Press Ctrl+Alt+S to open the project Settings/Preferences and go to Project <project name> | Python Interpreter. Click the Add Interpreter link next to the list of the available interpreters.
Supported languages PyCharm supports the following versions of Python: Python 2: version 2.7. Python 3: from the version 3.6 up to the version 3.11.
In the Project tool window, select the project root (typically, it is the root node in the project tree), right-click it, and select File | New .... Select the option Python File from the context menu, and then type the new filename. PyCharm creates a new Python file and opens it for editing.
Settings -> Editor -> Inspections -> Python -> Code compatibility inspection
Either disable it entirely or unselect Python 2.X
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