DeepMind
DeepMind

Reputation: 213

How to set the Python 2 Preference in PyCharm?

PyCharm is a good IDE, but its code hinting is not so intelligent. For example, when I use it to write Python2 code (the setting of my interpreter path can tell PyCharm this), I type prin, which I want PyCharm to give me a hint of print, however, the first prompt is print(), which is a Python3 style of function print. Is there any setting in PyCharm that I can tell it not to give me Python3 prompt when I am writing Python2 code (and not to give me Python2 prompt when I am writing Python3 code)?

My PyCharm version is 2.7.1

Upvotes: 14

Views: 34564

Answers (3)

monoid
monoid

Reputation: 1671

Perhaps, you should select python 2.x interpreter for the project (File Menu - Settings - Project - Project Interpreter).

Upvotes: 13

IRSHAD
IRSHAD

Reputation: 2933

Simply set the Python Interpreter from 3.x to 2.x as you want.

Steps of PyCharm Version: Community Edition 2016.3.2

  1. You need to install the interpreter first.

  2. Then go to File -> Settings -> Project:dev -> Project Interpreter -> Set Python 2.7 enter image description here

  3. Now go to Run -> Edit Configuration -> and set python Interpreter 2.7 here as given in the snapshot below- Python Interpreter 2.7

Upvotes: 5

MatheMatrix
MatheMatrix

Reputation: 1

Maybe this can help:

Run->Edit Configurations, Replace all Py3 to Py2

I use PyCharm 3.0.1

Upvotes: 0

Related Questions