Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python3 syntax in PyCharm

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?

like image 626
Till Hoffmann Avatar asked Jul 26 '16 11:07

Till Hoffmann


People also ask

How do I add python3 to PyCharm?

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.

Does PyCharm have python3?

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.

How do I use Python IDE in PyCharm?

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.


1 Answers

Settings -> Editor -> Inspections -> Python -> Code compatibility inspection

Either disable it entirely or unselect Python 2.X

like image 163
DeepSpace Avatar answered Oct 16 '22 14:10

DeepSpace