Follow these steps to set Python 2.7 reference in PyCharm:
Setting Python 2.7 in PyCharm
I am assuming that you have installed the Python 2.7 and PyCharm already; if not, check this link How to Download and Install Python on Windows 10?.
1. Open PyCharm, then click on the
File > Preferences.
2. Then select the
Project Interpreter option from the left and click on the drop-down list on the right side as shown in the following image:
See, if you find the Python 2.7 version in the above drop-down list, then select it and click on the
OK button, else move to the next step.
3. After clicking on the
Show All option, it will display the window. Select the Python 2.7 if visible in the above list, else click on the
+ icon below, as shown in the below image:
4. Now in this step, click on the
Virtual Environment and select the Python 2.7 from the
New Environment option. You can also select the
System Interpreter and select the Python 2.7 for it as well. Then click on the
OK button, and all on the windows opened previously.
You have configured the Python 2.7 for PyCharm, and now you can compile and run Python 2.7 version programs.