VS Code and PyCharm for Python: IDE Setup, Extensions, Interpreter, Terminal, and Debugging
Quick Answer
Use VS Code if you want a lightweight editor that works across many languages. Use PyCharm if you want a Python-first IDE with more built-in project tooling.
For both tools, the most important setup step is selecting the correct Python interpreter.
Last verified: June 9, 2026.
VS Code public release notes currently show version 1.124. PyCharm's current product line is unified PyCharm, where core Python features are free and Pro features are available through trial/subscription.
Official Links
- VS Code download: https://code.visualstudio.com/Download
- VS Code Python docs: https://code.visualstudio.com/docs/languages/python
- VS Code Python extension: https://marketplace.visualstudio.com/items?itemName=ms-python.python
- VS Code Jupyter extension: https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyter
- PyCharm download: https://www.jetbrains.com/pycharm/download/
- Git downloads: https://git-scm.com/downloads
What You Will Learn
By the end, you should be able to:
- choose VS Code or PyCharm
- install the right Python editor tools
- select a
.venvinterpreter - run Python files
- debug Python code
- fix package visibility problems
- use notebooks from your editor
1. VS Code vs PyCharm
| Tool | Best for |
|---|---|
| VS Code | Lightweight coding, Python, web, notebooks, Git, extensions |
| PyCharm | Python-focused projects, deeper IDE tooling, project management |
Recommendation:
- Start with VS Code if you are learning Python and also want web/data/AI tools later.
- Choose PyCharm if you prefer a full Python IDE with more built-in guidance.
Both are good. The interpreter setup matters more than the editor choice.
2. Install VS Code
Download from:
https://code.visualstudio.com/DownloadWindows:
- Download the Windows installer.
- Run it.
- Keep
Add to PATHenabled if offered. - Open VS Code.
macOS:
- Download the macOS build.
- Drag Visual Studio Code into Applications.
- Open VS Code.
- Optional: install the
codeshell command from VS Code command palette.
If the download page offers separate builds, choose:
- Apple Silicon for M1, M2, M3, M4, and newer Apple chips
- Intel for older Intel Macs
- Universal if you want one build that works across both
3. Install VS Code Extensions
Install the official Microsoft Python extension:
https://marketplace.visualstudio.com/items?itemName=ms-python.pythonInstall the official Jupyter extension:
https://marketplace.visualstudio.com/items?itemName=ms-toolsai.jupyterIn VS Code:
- Open Extensions.
- Search
Python. - Install the Microsoft Python extension.
- Search
Jupyter. - Install the Microsoft Jupyter extension.
4. Open A Project Folder In VS Code
Do not open a random file alone. Open the whole project folder.
Windows:
mkdir python-vscode-demo
cd python-vscode-demo
code .macOS:
mkdir python-vscode-demo
cd python-vscode-demo
code .If code is not available on macOS:
- Open VS Code.
- Press
Cmd+Shift+P. - Run
Shell Command: Install 'code' command in PATH. - Open a new terminal.
5. Create And Select A Virtual Environment In VS Code
Windows:
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install requestsmacOS:
python3 -m venv .venv
source .venv/bin/activate
python -m pip install requestsThen in VS Code:
- Press
Ctrl+Shift+Pon Windows orCmd+Shift+Pon macOS. - Search
Python: Select Interpreter. - Choose the interpreter inside
.venv. - Open a
.pyfile. - Confirm the selected interpreter appears in the status bar or Python environment picker.
If packages are missing in VS Code, the wrong interpreter is selected.
6. Run Python In VS Code
Create hello.py:
import sys
print("Hello from VS Code")
print(sys.executable)Run it using:
- the Run button
- right click -> Run Python File in Terminal
- terminal command
Windows:
python hello.pymacOS:
python hello.pyIf .venv is activated, python should be the environment Python.
7. Debug In VS Code
Add this file:
def add_tax(price, rate):
return price + (price * rate)
total = add_tax(100, 0.18)
print(total)To debug:
- Click beside a line number to add a breakpoint.
- Press
F5or choose Run and Debug. - Select Python debugger if asked.
- Step through the code.
Debugging lets you see variable values while code runs.
8. Install PyCharm
Download from:
https://www.jetbrains.com/pycharm/download/PyCharm is now a unified product. Core Python development features are free, and Pro features are available through trial/subscription. PyCharm also includes Jupyter support in core functionality.
On macOS, choose the download that matches your chip:
- Apple Silicon for M1, M2, M3, M4, and newer Apple chips
- Intel for older Intel Macs
Beginner setup:
- Download PyCharm.
- Install it for your operating system.
- Create a new project.
- Choose a virtual environment for that project.
9. Select Python Interpreter In PyCharm
In PyCharm:
- Open the project.
- Go to Settings or Preferences.
- Open Project -> Python Interpreter.
- Choose the
.venvinterpreter. - Install packages through the terminal or package UI.
Windows .venv interpreter often looks like:
.venv\Scripts\python.exemacOS .venv interpreter often looks like:
.venv/bin/python10. Run And Debug In PyCharm
Create hello.py:
print("Hello from PyCharm")Right click the file and choose Run.
To debug:
- Add a breakpoint.
- Right click the file.
- Choose Debug.
- Step through variables.
11. Install Packages In IDEs
Terminal method after activating .venv:
python -m pip install pandas matplotlibVS Code:
- open integrated terminal
- make sure
.venvis active - run pip through Python
PyCharm:
- use the built-in terminal, or
- use the interpreter package UI
Always install into the same interpreter selected by the IDE.
12. Jupyter In IDEs
For notebooks in VS Code:
- Install the Jupyter extension.
- Open a
.ipynbfile. - Choose the
.venvkernel.
For notebooks in PyCharm:
- Open or create a notebook.
- Select the project interpreter/kernel.
- Install missing packages into that interpreter.
If a notebook cannot import a package, its kernel is different from your terminal environment.
13. Common IDE Mistakes
Package works in terminal but not VS Code
Select the .venv interpreter in VS Code.
Check inside VS Code terminal:
python -c "import sys; print(sys.executable)"VS Code cannot find Python
Check terminal first.
Windows:
py --version
where.exe python
where.exe pymacOS:
python3 --version
which python3Then restart VS Code.
PyCharm created a different environment
Open interpreter settings and switch to the .venv inside your project.
FileNotFoundError in IDE
Your working directory may be different. Open the full project folder and use paths relative to the project root.
14. Update Or Uninstall IDEs
VS Code:
- update from Help -> Check for Updates, or download the latest installer again
- uninstall from Windows Settings -> Apps or by removing the app from macOS Applications
PyCharm:
- update from the built-in JetBrains update flow or JetBrains Toolbox if you use it
- uninstall from Windows Settings -> Apps or by removing the app from macOS Applications
After updating an IDE, recheck the selected Python interpreter. Updates should not change it, but it is the first thing to verify if packages suddenly look missing.
FAQ
Which should I use first, VS Code or PyCharm?
Use VS Code if you want one editor for Python, web, data, and AI workflows. Use PyCharm if you want a Python-first IDE.
Do I need both?
No. One is enough. Learning both later is useful, but not required.
Why does the IDE not see my package?
The IDE is using a different Python interpreter or Jupyter kernel.
Should I install packages from the IDE UI or terminal?
Terminal commands are easier to understand and repeat. Use the IDE UI after you understand environments.
Final Checklist
Windows:
py --version
py -m venv .venv
.\.venv\Scripts\Activate.ps1
python -m pip install requests
python -c "import requests; print(requests.__version__)"macOS:
python3 --version
python3 -m venv .venv
source .venv/bin/activate
python -m pip install requests
python -c "import requests; print(requests.__version__)"Then confirm your IDE uses the .venv interpreter.
