PyCharm

Contents
Introduction
Installation
Code editor basics
Install a module in PyCharm
Check the virtual environment
Automatically activate the environment
Add Git Bash to the terminal
Switch between terminal tabs
Related articles

Introduction

PyCharm is an integrated development environment for the Python programming language. It provides code analysis tools, a graphical debugger, a unit test runner, and supports web development in Django. PyCharm is developed by JetBrains based on IntelliJ IDEA.

PyCharm is a cross-platform development environment compatible with Windows, macOS, Linux. PyCharm Community Edition (free) is licensed under the Apache License, while PyCharm Professional Edition (paid) is proprietary software.

For support of the Robot Framework in PyCharm, you can read about here

Installation
Installing with pip
Installing on Linux
Code Editor
Place cursor at beginning of multiple lines
Vertical line delimiter
Split window into two parts
Switch between terminal and code editor
Remove green background from code
Comment out selected code
refactor: Rename a function in a file
Wrap code

Install a module in PyCharm

Let's look at how to install additional modules and libraries in PyCharm using requests as an example.

Go to the project settings by clicking

CTRL + ALT + S

Installing the requests module in PyCharm .image from https://www.aredel.com website
File - Settings

Find the Project: name of your project section

Select the Project Interpreter or Python Interpreter subsection

Click the plus sign on the right side of the screen

Installing the requests module in PyCharm .image from https://www.aredel.com website
Project Interpreter

The Available Packages window should appear.

Enter the name of the desired module in the search bar. In my case, it's requests

Installing the requests module in PyCharm .image from https://www.aredel.com website

Click the Install Package button

Installing the requests module in PyCharm .image from https://www.aredel.com website
Click Install

Wait for the installation to complete

Installing the requests module in PyCharm .image from https://www.aredel.com website
Wait for the installation to complete

Check the virtual environment

If you're running a script in PyСharm examine the terminal output

/home/andrei/pytest/venv/bin/python /home/andrei/pytest/main.py

Process finished with exit code 0

/home/andrei/pytest/venv/bin/python

- this is the path to the Python used.

If the script were run by the default Python

/usr/bin/python3.8

Disable automatic activation of the environment

To stop PyCharm from automatically activating the virtual environment when you navigate to a directory, uncheck the Activate virtualenv box in

Settings Tools Terminal Application Settings Activate virtualenv

Disable automatic virtual environment activation in PyCharm image from https://www.aredel.com website
Automatic activation is disabled
https://aredel.com

Add Git Bash to the PyCharm Terminal

If you want to use Git Bash inside the PyCharm window, select

File Settings Tools Terminal

And set Shell path: as

C:\Users\Andrei\AppData\Local\Programs\Git\bin\bash.exe

Then, when you click +, a new Git Bash will appear in the terminal toolbox, while other consoles will still be accessible from the drop-down menu.

If you set Shell path as

C:\Users\Andrei\AppData\Local\Programs\Git\git-bash.exe

Then when you click + Git Bash will open in a separate window.

If you plan to activate virtual environments manually, I recommend disabling automatic virtual environment activation

Bash commands disappear in Git Bash terminal after activation

If you added Git Bash as a terminal in PyCharm and after activating the virtual environment, bash commands stop working. For example, ls

ls

bash: ls: command not found

I recommend checking to see if automatic virtual environment activation is disabled.

Settings Tools Terminal Application Settings Activate virtualenv

It is possible that double activation is occurring, so disabling this option will return the bash commands.

Switch between terminal tabs

The key combination depends on the operating system.

I have Windows 11 and it works.

Alt +

Alt +

Related Articles
PyCharm: IDE
Install
Add Path to Project
Editor Basics
Python
Add Selenium to PyCharm

Search on this site

Subscribe to @aofeed channel for updates

Visit Channel

@aofeed

Feedback and Questions in Telegram

@aofeedchat