E.g.:
print 'abc'
gets highlighted with a message:
Python version >= 3.0 do not support this syntax.
How to disable that, since I'm on Python 2?
I know about import __future__
but I don't want to use it now.
I've looked under inspections in the settings, but could not find anything relevant.
The Project Interpreter setting for the project is already 2.7.6, and my programs do run correctly (they wouldn't if the interpreter used to run were python 3).
Pycharm Community Edition 2016.3.1, Ubuntu 14.04, python
in PATH
is Python 2.
In the Settings/Preferences dialog ( Ctrl+Alt+S ), select Editor | Inspections. Locate the inspection you want to disable, and clear the checkbox next to it. Apply the changes and close the dialog.
Press Ctrl+Alt+S to open the IDE settings and select Editor | Inspections. Select the profile that you want to modify and then choose an inspection from the list. Make sure that it is enabled. From the In All Scopes list, select the scope for which you want to change the severity.
Change the Python interpreter in the project settingsPress Ctrl+Alt+S to open the IDE settings and select Project <project name> | Python Interpreter. Expand the list of the available interpreters and click the Show All link. Select the target interpreter.
I believe what causes this warning is the Editor Inspector and the python version that is set to check.
In Python 2 print
is statement, but in Python 3 is a function so it requires parenthesis
Go to Settings > Editor > Inspections
. On the Search Field type "Code compatibility inspection"
under Python.
Check what python version you have selected on the Options
. If you have ticked anything else than 2.7
, un-select it and just leave 2.7
as selected.
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