Python Development

Guides for setting up and working with Python in VS Code and PyCharm: interpreters, virtual environments, pip and packages, running, testing and debugging. Start with the task table below to find the right guide for your editor.

Showing all 61 guides

Find the guide for your task

Pick a task to see the guide for VS Code and for PyCharm side by side, or switch to one editor to hide the other column.

What you want to doVS CodePyCharm
Set up the editor for PythonSet up VS Code for PythonSet up PyCharm
Choose the Python interpreterChange the interpreterAdd an interpreter Change the Python version
Create a virtual environmentHandled automatically or not covered yetCreate a venv in PyCharm
Activate a virtual environmentActivate a venvHandled automatically or not covered yet
Leave a virtual environmentExit a venvHandled automatically or not covered yet
Install pipInstall pipInstall pip
Fix "pip is not recognized"Fix the errorHandled automatically or not covered yet
Install packagesInstall MatplotlibInstall packages pandas NumPy
Run a scriptRun PythonRun code
DebugDebug PythonDebug in PyCharm
Run tests with pytestRun pytestRun pytest
Comment out several linesComment linesComment code
Open a terminalOpen the terminalOpen the terminal
Work with Jupyter notebooksHandled automatically or not covered yetJupyter in PyCharm
Connect to GitHubConnect to GitHubConnect to GitHub

The virtual environment lifecycle

The same five commands work in any terminal, including the ones built into VS Code and PyCharm. Use py instead of python on Windows if python isn’t on your PATH.

StepWindows (Command Prompt)macOS and Linux
Create a venv in the project folderpython -m venv .venvpython3 -m venv .venv
Activate it.venv\Scripts\activatesource .venv/bin/activate
Install packages into itpython -m pip install requestspython -m pip install requests
Save the package listpython -m pip freeze > requirements.txtpython -m pip freeze > requirements.txt
Leave itdeactivatedeactivate
Delete itrmdir /s /q .venvrm -rf .venv

Not sure venv is the right tool? venv vs conda vs Poetry compares the three, and How to delete a Python venv covers cleaning up safely.

Virtual environments and packages

14

Keep each project’s dependencies separate, install the packages you need, and fix pip when it misbehaves.

venv vs conda vs poetry: Which One for Which ProjectAsk around and most Python developers will say they use venv, though not always because they compared it against anything. It’s usually…17 min read Updated How to Delete a Python venv Without Breaking Your Project62% of Python developers now isolate their projects with venv, up from 55% a year earlier (Python Developers Survey 2024, JetBrains and…17 min read Updated How to Activate Venv in VSCode for PythonYour Python packages are installing globally. Again. Learning how to activate venv in VSCode prevents dependency conflicts and keeps your projects clean.…9 min read Updated How to Exit Venv in VSCode Step-by-StepYou activated your Python virtual environment. Now you’re stuck in it. Knowing how to exit venv in VSCode is a basic skill…9 min read Updated How to Create a Virtual Environment in PyCharmMaking a virtual environment in PyCharm happens mostly in the New Project dialog. Open File > New Project, choose Project venv, and…14 min read Updated How to Install Pip on VSCodeYou just installed Python, opened VSCode, and typed pip install. Nothing happened. Figuring out how to install pip on VSCode trips up…9 min read Updated How to Install Pip in PyCharm ExplainedTo install pip in PyCharm, run python -m ensurepip –upgrade in the Terminal tool window while the project interpreter is active. Most…13 min read Updated pip is not recognized in VS Code: Why It Happens and How to Fix Itpip is not recognized in VS Code shows up more than almost any other Python terminal error, and most of the time…16 min read Updated How to Install Packages in PyCharm QuicklyIn PyCharm, installing a package mostly comes down to one search and one click. Open the Python Packages tool window, type the…17 min read Updated How to Install Libraries in PyCharm FastInstalling a library in PyCharm starts in the Python Packages tool window. Search for the package name, click Install, and pick a…14 min read Updated How to Install Pandas in PyCharm GuideOpen the Python Packages tool window, type pandas in the search field and click Install. PyCharm puts the package into the interpreter…12 min read Updated How to Install NumPy in PyCharm EasilyIn the Python Packages tool window, search for numpy and click Install. PyCharm adds the package to the interpreter selected for the…14 min read Updated How to Install PyGame in PyCharm QuicklyIn PyCharm, pygame goes in through the Python Packages tool window. Search for it, click Install, and you’re done. The library lands…14 min read Updated How to Install Matplotlib in VSCodeYou wrote the code. Now you need to see the data. Learning how to install matplotlib in VSCode takes about 3 minutes…8 min read Updated

Python in VS Code

6

Configure VS Code for Python, then run, debug and test your code from the editor.

PyCharm: install and set up

9

Choose an edition, install PyCharm on your system, and keep it up to date.

What Is PyCharm: A Beginner’s GuideJetBrains makes PyCharm, a Python IDE that analyzes your code while you type. Completion, refactoring, debugging, testing, and environment management all sit…18 min read Updated PyCharm Community vs Professional: Which Should You Pick?Picking the wrong PyCharm edition costs you either money or productivity. The PyCharm Community vs Professional debate comes down to one question:…17 min read Updated How to Install PyCharm on WindowsDownload the .exe installer from JetBrains, run the wizard, and open PyCharm from the Start menu or the desktop shortcut. That covers…13 min read Updated How to Install PyCharm on Mac: Beginner’s GuideGetting your Python environment up and running on Mac takes less than ten minutes. But only if you know which build to…14 min read Updated How to Install PyCharm on LinuxJetBrains lists the Toolbox App as its recommended way to install PyCharm on Linux. Snap works as well, but the same guide…18 min read Updated How to Setup PyCharm for Your ProjectsPyCharm installs the same way on Windows, macOS and Linux. The installer is the quick part. Most of the time goes into…21 min read Updated How to Use PyCharm: Tips for BeginnersCommunity and Professional merged into a single PyCharm in version 2025.1, and the free core now includes Jupyter Notebook support (JetBrains documentation,…21 min read Updated How to Update PyCharm to the Latest VersionOpen Help | Check for Updates (PyCharm | Check for Updates on macOS), accept the patch it offers, and restart the IDE.…17 min read Updated How to Uninstall PyCharm Without Leaving TracesClicking “Uninstall” isn’t enough. Not with PyCharm. Most developers who uninstall PyCharm walk away thinking the job is done, only to find…16 min read Updated

PyCharm: everyday work

15

Projects, interpreters, running and debugging code, tests, notebooks and the shortcuts and plugins that speed it all up.

How to Create a New Project in PyCharmFile | New Project does it, or the New Project button on the Welcome screen. Set a location, choose an interpreter, click…14 min read Updated How to Add Python Interpreter in PyCharmIn PyCharm, press Ctrl+Alt+S to open Settings, go to Python | Interpreter and click Add Interpreter. Choose Add Local Interpreter, then pick…17 min read Updated How to Change Python Version in PyCharmTo change the Python version in PyCharm, click the Python Interpreter selector in the status bar and pick an interpreter built on…14 min read Updated How to Run Code in PyCharm Step by StepRight-click the open file and choose Run. That’s all it takes. PyCharm picks up the project interpreter, executes the script and prints…15 min read Updated How to Debug in PyCharm Like a ProSet a breakpoint by clicking the gutter beside an executable line, then start the program with the Debug icon or Shift+F9 on…20 min read Updated How to Run Pytest in PyCharm: A Complete WalkthroughRunning pytest in PyCharm takes about two minutes to set up correctly. Most developers spend two hours debugging why it isn’t working.…19 min read Updated How to Use Jupyter Notebook in PyCharm EffectivelyRunning a Jupyter notebook inside PyCharm gives you something browser-based Jupyter never could: a real debugger, live variable inspection, and full IDE…18 min read Updated How to Open Terminal in PyCharm Quickly & EasilyMost PyCharm users spend more time than they should hunting for the terminal on their first day. Knowing how to open the…14 min read Updated How to Comment in PyCharm for EfficiencyThe shortcut is Ctrl+/ on Windows and Linux and Cmd+/ on macOS. Press it on a line, or on a selection, and…12 min read Updated How to Undo in PyCharm: Shortcut GuideMost mistakes in PyCharm are one Ctrl+Z away (Cmd+Z on macOS), as long as the IDE has stayed open since you made…14 min read Updated How to Zoom in PyCharm for Better ViewPyCharm doesn’t have one zoom control. It has several, and each scales something different, which is why a zoom that fixes the…10 min read Updated How to Delete a Project in PyCharm EasilyPyCharm can’t delete a project in one step. You take the project off the recent projects list from inside the IDE, then…15 min read Updated How to Connect PyCharm to GitHub EasilyTo connect PyCharm to GitHub, press Ctrl+Alt+S, open Version Control | GitHub, click Add, and log in through the browser or with…13 min read Updated The Best PyCharm Plugins to Supercharge Your WorkflowThe default PyCharm setup is good. A well-chosen plugin stack makes it genuinely great. Python now tops GitHub as the most-used language…22 min read Updated PyCharm Keyboard ShortcutsUnlock the full potential of PyCharm with our PyCharm keyboard shortcuts. Discover how to streamline your workflow, enhance productivity, and navigate effortlessly…7 min read Updated

Choosing a Python editor

7

How PyCharm compares with VS Code, IntelliJ IDEA, Spyder, Jupyter, Anaconda and Sublime Text.

Python for the web

6

Frameworks, editors and real-world projects for building web applications with Python.

The Python ecosystem

4

Usage numbers, well-known apps built with Python, and the languages people compare it with.

Frequently asked questions

What is a Python virtual environment?

A virtual environment is a folder with its own Python interpreter and its own installed packages, so each project can use different package versions without affecting the others. You create one with python -m venv and activate it before installing packages.

Should I use venv, conda or Poetry?

venv ships with Python and is enough for most applications. conda also manages non-Python dependencies, which is why it is common in data science. Poetry adds dependency resolution, lock files and packaging on top of virtual environments.

Why should I run pip as python -m pip?

Running python -m pip guarantees that pip installs packages into the interpreter you just called, which avoids the common case where pip and python point to different installations.

Is PyCharm free?

You can use PyCharm’s core Python features for free. Advanced tools for web frameworks, databases and scientific work need a paid subscription, and JetBrains has changed how the editions are packaged over time, so check the current plans before you buy.

VS Code or PyCharm for Python?

VS Code is a lighter, general-purpose editor that you extend for Python. PyCharm is an IDE built specifically for Python, with more refactoring and project tools out of the box. Both handle virtual environments, debugging and testing well.

These guides are written by Bogdan Sandu and published by TMS Outsource, a custom software development company founded in 2014, with engineering offices in Belgrade and Bucharest. If you need a team to build or extend a web or mobile product, see our software development services or get in touch.