SoFunction
Updated on 2024-11-15

PyCharm First Installation and Usage Tutorial

Introduction to pycharm

PyCharm is a Python IDE that comes with a full set of tools that can help users improve their efficiency when developing with the Python language, such as debugging, syntax highlighting, Project management, code jumping, smart hints, autocompletion, unit testing, and version control. In addition, the IDE provides some advanced features for supporting professional web development under the Django framework.

1 PyCharm download

PyCharm download and installation is very simple, you can directly to the official website of Jetbrains, the specific steps are as follows:

(1) Open the Pycharm websiteTo download PyCharm, select the PyCharm item under the Tools menu, as shown in Figure 1, and enter the PyCharm download interface.

Figure 1 PyCharm official web page

(2) In the PyCharm download page, click the "DOWNLOAD NOW" button, as shown in Figure 2, into the PyCharm environment selection and version selection interface.

Figure 2 Pycharm download page

(3) Select the development environment for downloading Pycharm for Windows and click Start to download the community version of PyCharm (Communit), as shown in Figure 3.

Figure 3 Pycharm environment and version download selection page

(4) in the pop-up download dialog box to set the download file storage path, in order to make the download file is easy to find, try to set the file storage path is familiar with the path or the root path, such as this paper set up the download path for "D:\". As shown in Figure 4.

Figure 4 Pycharm download path settings page

(5) Click the "Download" button to start the download. After the download is complete, you can see the Pycharm installation file has been downloaded in the D disk. As shown in Figure 5.

Figure 5 Completed Pycharm installer download

2 Installing the software

The steps to install PyCharm are as follows:

(1) Double-click the PyCharm installation package to install, click the "Next" button in the welcome interface to enter the software installation path setting interface.

(2) In the software installation path setting interface, set a reasonable installation path. It is strongly recommended not to install the software to the path of the operating system, otherwise there will be a crash of the operating system and other special circumstances, you must redo the operating system, PyCharm program path under the program will be destroyed.PyCharm default installation path for the operating system path, it is recommended that we change the installation path, and installation of the path is recommended not to use Chinese characters. I chose the installation path for "D:\PyCharm", as shown in Figure 6. Click the "Next" button to create a shortcut to the interface.

Figure 6 Setting the Pycharm installation path

(3) Set a shortcut to the PyCharm program in the Create Desktop Shortcut screen. If the computer operating system is 32-bit, select "32-bit launcher", otherwise select "64-bit launcher". Here the computer operating system is a 64-bit system, so choose "64-bit launcher"; Next, set the associated files (Create Associations), check the checkbox to the left of the .py, so that in the future and then open the .py (.py file is a python script) Py (.py file is a python script file, the next we write a lot of programs are .py) file, it will be the default call PyCharm open, as shown in Figure 7.

Figure 7 Setting shortcuts and associations

(4) Click the Next button to enter the Start Menu folder selection interface, shown in Figure 8, the interface does not need to set up, using the default can be, click the Install button (about 10 minutes to install, need to be patient).

Figure 8 Select Start Menu folder screen

(5) After the installation is complete, click Finish button to end the installation, as shown in Figure 9. You can also check the box in front of the "Run PyCharm Community Edition", click the Finish button, so you can directly run the PyCharm development environment.

Figure 9 Completing the installation

(6) After PyCharm installation is complete, a folder will be created in the Start Menu, as shown in Figure 10, click "JetBrains PyCharm Community Edition 2018.1" to start the PyCharm program. Of course, the quick way to open PyCharm is to click the desktop shortcut "JetBrains PyCharm Community Edition 2018.1 x64", the icon is shown in Figure 11.

Figure 10 Pycharm Menu Figure 11 Pycharm Desktop Shortcut

3 Running PyCharm

The steps to run the PyCharm development environment are as follows:

(1) Click the Pycharm desktop shortcut to start the PyCharm program. Choose whether to import the development environment configuration file, here choose not to import, click the OK button to enter the Read Agreement page, as shown in Figure 12.

Figure 12 Environment profile form

(2) Drag the scroll bar of the agreement text box to the bottom of the text box, indicating that the agreement has been read, at this time, the Accept button from gray unavailable to available, as shown in Figure 13. Click the Accept button to enter the user UI plug-in extension installation interface (the implementation of this step, depending on the machine, there may be a data information sharing page, directly click the "Don't send" button can be).

Figure 13 Accepting the Pycharm protocol

(3) Select "Skip Remaining and Set Defaults" to skip the remaining settings and configure the development environment using the system default settings, as shown in Figure 14, at this time the program will enter the welcome interface.

Figure 14 User UI plugin extension installation interface

4 Creating a Project Catalog

In order to store your PyCharm project files conveniently, you have to set the location of the project directory in the Pycharm welcome screen. The method is as follows:

(1) Enter the PyCharm welcome page, click "Create New Project" to create a new project file, as shown in Figure 15.

Figure 15 Pycharm Welcome Screen

(2) PyCharm will automatically set a storage path for the new project file. In order to better manage the project, it is best to set an easy-to-manage storage path, you can directly enter the storage path where the project file will be placed in the Storage Path input box, or you can click the Storage Path Selection button on the right side to open the Path Selection dialog box for selection (the storage path can not be the python storage path that has already been set), as shown in Figure 16.

Figure 16 Setting the python storage path

(3) If you set the installation path through the Path Selection dialog box, you can select an existing folder as the storage path, as shown in Figure 17. You can also click the "new fold" button to create a new folder to store the project files, as shown in Figure 18. Do not set the storage path to the disk where the operating system is located, and try to store the storage path to a path that is easy to find. After the storage path is set, click the Create button to create the project file.

Figure 17 Setting the storage path via the path selection dialog box

Figure 18 Creating a new folder as a storage path

(4) When the creation of the project is completed, you will enter the project list as shown in Figure 19.

Figure 19 Creating a new folder as a storage path

(5) When the program is first started, it displays a daily post that provides one tip at a time on the application of Pycharm features. If you want to turn off the Tip of the Day feature, you can check off the Show Tip of the Day checkbox and click the Close button to close the Tip of the Day, as shown in Figure 20. If you want to display the Tip of the Day again at a later time after closing it, you can start the Tip of the Day by clicking the Help→tip of the day menu item in the PyCharm development environment menu.

Figure 20 Pycharm Post of the Day

5. Writing the "hello world" program

The previous steps have started the PyCharm development environment, which is next used to write the hello world program in the following steps:

(1) right-click on the just-built dream project, in the pop-up menu, select New--> PythonFile menu item (be sure to select the PythonFile item, this is critical, otherwise you can not follow up on the study), as shown in Figure 21.

Figure 21 Pycharm official web page

(2) In the New File dialog box, enter the name of the python file you want to create, "hello world", as shown in Figure 22 and Figure 23. Click the "OK" button to complete the new python file.

Figure 22 New File dialog box before input Figure 23 New File dialog box after input is complete

(3) in the newly created code editing area to complete the file enter the code "print ("hello world!")". After the completion of the input code will find a small yellow light bulb, as shown in Figure 24, this is the editor of the input code to provide advice, do not pay attention. Select the Run-->Run... menu item to run the program, as shown in Figure 25.

Figure 24 Inputting the "hello world code".

Figure 25 Run Menu

Description: Click Run main menu, you can see the pop-up menu in the first two menus "Run" (Run) and "Debug" (Debug) is grayed out, can not be triggered state, as shown in Figure 26. The toolbar buttons for Run and Debug are also not available, as shown in Figure 26. This is because the first time you run the program, you need to configure the program you want to run.

Figure 26 Run button on toolbar not available

(4) Select "hello world" in the pop-up menu to run the program, as shown in Figure 27.

Figure 27 Setting the program to run

(5) If there are no errors in the program code, the result of the run will be displayed. As shown in Figure 28.

Figure 28 Program operation results

Description: When writing a program, sometimes the code contains a small yellow light bulb popping up underneath, what is it used for?

There are actually no errors in the program, just some suggestions or reminders from Pycharm to improve the code. Such as adding comments, creating use sources, etc. Displaying a yellow light bulb will not affect the result of running the code, the

summarize

The above is a small introduction to the first installation and use of PyCharm tutorials, I hope to help you, if you have any questions please leave me a message, I will promptly reply to you. Here also thank you very much for your support of my website!
If you find this article helpful, please feel free to reprint it, and please note the source, thank you!