This article is about installing Anaconda Python Distribution and PyCharm IDE to setup a Python Development Environment.
The steps described here should work on Windows/7/8/10 machines.
Installing Anaconda Python Distribution
Go to the link below
You have the option to download either Python 2.7 distribution (32 bit or 64 bit) or Python 3.4 distribution (32 bit or 64 bit). At the time of writing this article Anaconda Supported Python 3.4 distribution. In future it’ll be updated to the latest version of Python.
For our demo, I have downloaded Anaconda Python 2.7 distribution (64 bit).
Click on the Anaconda Python distribution Anaconda-2.2.0-Windows-x86_64.exe (the versioning number may be different when you download) which you have downloaded. As seen in the below screen the setup starts loading.
You will get a screen as shown below. Click Next.
You will get a License Agreement Screen. Click on I Agree.
Assuming that you are the only User on your System, select Just Me radio button. Click on Next.
You need to choose an location to install Anaconda Python distribution. The default installation will be under Users as shown below.
Lets change the installation path as show in the below screen. Click on Next.
In the Advanced Installation Options screen, select all the check boxes.
This starts the installation of Anaconda Python Distribution.
Once the Installation is complete click on Next button.
Finish the setup.
To check whether the installation is working properly or not, go to the command prompt and type python. You should see a series of lines and a prompt as shown in the screen below.
Installing PyCharm IDE
Go to the link below
You have the option to download either the PyCharm Professional Edition or the PyCharm Community Edition. If you have purchased an license for Professional Edition then go for it. Else, you can download the Community edition which will suffice most of our requirements.
Create a folder called PyWork in C:\ Drive.
Click on the executable which you have downloaded. You will be presented with the below screen. Click on Next.
Go with the default destination folder to install PyCharm Community Edition. Click on Next.
Select all the Check Boxes in the Installation Options and Click on Next.
Step 5: Go with the default Start Menu Folder as shown in the screen and Click on Install.
It’ll take some time for the installation to finish.
Step 6: Once the installation is over click on the Finish button.
Step 7: You will be asked whether you want to import previous PyCharm settings. Since we are starting on a clean slate, lets select the second radio button and click on OK button.
You will be prompted with a Windows Security Alert. Do not worry about it. Click on Allow Access Button.
You will be presented with the below screen. Let the default settings remain as it is and click on OK button.
In the next screen, go to Configure and select Settings.
In the Default Settings screen, on the left pane, expand the Default Project option and click on Default Interpreter.
On the right pane, in the Project Interpreter option, click on the pull down menu and select the python path and click Apply button.
Step 12: It will take some time for all the packages to be listed.
Once done click on OK button.
You will be again presented with the Welcome screen. Click on Create New Project option.
For the Location option, browse to the PyWork folder which you created in C:\ drive in Step 1. Now give a name to your Python Project. For the purpose of demo, I have given the Python Project name as FirstProgram.
You should always create different projects for executing different Python Programs.
Click on Create button.
On the left pane of the presented screen you can see the Project Name. Right click on the FirstProgram ⇒ Select New ⇒ Select Python File.
Give a name to the Python File. In our case it is HelloWorld. No need to specify the extension. The IDE itself will attach the .py extension to the file name which you have specified.
Click on OK button.
On the left pane double click on the File name which you have created (in our case it is HelloWorld.py). On the right side of the editor type
print ‘Hello World’
To execute the above program, go to Run menu ⇒ Click on Run
Another way of executing the above program is, Right Click on the Python File Name (in our case it is HelloWorld.py) and select Run “HelloWorld”
In the below screen, you can see the output in the bottom pane of the PyCharm IDE.
You can add multiple Python files to the project and execute them individually.
Create another Python File by following the Steps 15, 16 and 17. Name the Python file as SecondPythonFile.
In the editor type
print ‘This is second File’
Right click on the SecondPythonFile.py file and select Run “SecondPythonFile”
You can see the output in the bottom pane of the IDE.
That’s all folks.
Hope you enjoy setting up the Python Development Environment.
Happy Coding !!!!!