Download PyCharm at the official website:
PyCharm has two editions: professional and community edition. Community edition is free and open-source develop tool. Click download button at Community section, save the setup file.
Double click the .exe setup file for install PyCharm. Click “Next”.
Choose install location, you might want to change the default installation directory if your “C” drive is running out of free space.
On this screen, you can decide whether you want to create desktop shortcut. You can also add “Open Folder as Poroject” to the context menu. The “Update Path Variable” means that you will be able to approach PyCharm from the Command Prompt directly. The “Update Context Menu” means that you will be able to right click on any folder in your computer and to have the option to open this folder as a project in PyCharm. By check the “Create associations”, you can then open your files directly in Pycharm. I would suggest to create the association if you do not prefer any other Python editor. After configuration, click “Next”.
Choose start menu folder, you can keep the default “JetBrains” as shortcuts name. Click “Install”.
Wait for the wizard to finish the installation process until the Successfully Installed message appears. Click “Finish” to exit the setup wizard.
Download and Install Python
PyCharm requires Python to run. Think of Pycharm as an accessory to coding in Python. PyCharm is simply an IDE that makes coding in Python much easier.
Let’s download Python at official site:
You can download the latest version of Python for windows:
Or install a specific version of Python (scroll down the download page):
In this case, let’s download Version 3.11 of Python. Click the download link:
Scroll to “Files” section. Download the “Executable Installer” that matches the system type. In this tutorial, we will download “Windows installer(64-bit) for windows”. Wait until the downloading completed.
Install with executable installer is quite simple, chick “Install now”, then keep click the “Next” button. Check the “Add Python.exe to PATH” box is recommended.
If you didn’t add Python to PATH then you would call it from the command line like this:
Whereas if you add it to PATH, you can run it like this:
However, the full Python installer for Windows is an executable file that is quite often blocked by system administrators. The Python “embedable” package which is just a simple zip file. The “windows embeddable package” is a minimal package of Python suitable for embedding into a larger application. The embeddable package uses Python as runtime and allows to distribute applications on Windows.
If you choose to download the embedable package, you will get a zip file. Unzip the file. Let’s assume you unzip it to “C:\python\”.
The embedable package doesn’t have pip with it. You can download the get-pip.py online.
Let’s assume you download it to “c:\get-pip.py”. Open the Command Prompt window, run follow command to install the pip.
We also need to config path. On the desktop, right click the “My Computer” icon and select “properties”. Click “About”, Click “Advanced system settings”.
Click “Environment Variables” in Advanced tag. In the User variables, select “Path” and “Edit”.
In the “Edit environment variable” window for path, click “New” and type in the path of Python(for example, “c:\python311\”.
Create your first PyCharm project
Execute PyCharm program, the follow screen will appear. Check the box confirm the user agreement and click the “Continue” button.
Choose if you would like to share anonymous data to JetBrains for improve its products. The follow screen will appear. On the “Welcome to PyCharm” screen, click “New Project”. In PyCharm, you do everything in the context of a project.
On the “New Project” screen,
Choose the project location: specify the directory for your project.
Project Interpreter drop down: create a new project interpreter or reuse an existing one.
New environment using: you have a drop down list to select one of Virtualenv, Pipenv, Poetry, or Conda, which are the tools that help to keep dependencies required by different projects. Let’s choose Virtualenv in this tutorial.
Location: specify the location of the environment.
Base interpreter: list of Python interpreters (Python 311 in this tutorial) installed on your system.
Inherit global site-packages: Select the Inherit global site-packages checkbox if you want that all packages installed in the global Python on your machine to be added to the virtual environment you’re going to create. This checkbox corresponds to the –system-site-packages option of the virtualenv tool.
Make it available to all other projects: whether to Make available to all projects.
Click “Create” to create a new project.
You will see the new project created.
Select file -> new from menu, choose Python file. Type the file name(“hello world” in this tutorial) and click “OK” button.
Inside code editor of “hello world.py” anywhere outside the code right click -> Run ‘Hello world’.
PyCharm executes your code in the Run tool window.
Enjoy your first script in PyCharm!