I noticed in the screenshot you provided: The python environment you are currently using in VScode is the global environment ("python3.8.5" in the lower left corner of the screenshot), but the terminal is in the virtual environment (.venv), so VSCode cannot find this module.

Solution:

  1. You can use the shortcut key Ctrl+shift+ ' to open a new terminal, and VSCode will automatically enter the current global environment, and the module can be imported and used after installation with "pip install matplotlib":

  2. You can also choose this .venv environment with the matplotlib module installed:

Reference: Using Python environments in VS Code.

Answer from Jill Cheng on Stack Overflow
Discussions

python - VSCode: There is no Pip installer available in the selected environment - Stack Overflow
The terminal opens fine, pip is ... in VSCode, but when I try running the Format Document command I get the same errors that autopep8 and pip aren't available in the environment. ... What platform are you on, what Python are you using, and how did you install it? If you're on Linux, you may have installed a distro Python package that splits pip out into a separate package, like python-pip, in which case you need to install that. If you're on macOS, you may be ... More on stackoverflow.com
🌐 stackoverflow.com
How do I install PIP in my VS code?
You don't put it in vscode, you execute it in a terminal. For example, "pip install requests" will install the requests library globally. Ideally, you want to create a virtual environment, then invoke/activate it, then install your dependency, and then run your code from the same terminal in which you created, activated and installed the dependency: This is the standard way of doing it: https://docs.python.org/3/library/venv.html There are modern alternatives, but perhaps focusing on the above for now might be easier to grasp. More on reddit.com
🌐 r/learnpython
15
1
July 16, 2025
python 3.x - How to use pip with Visual Studio Code - Stack Overflow
I am pretty sure if you add your ( Python 3.6 installation ) location to the system path it should be resolved. ... If everything is alright, you should see the list of commands, which you can use. They are listed in your terminal, as per below. I also would advise you to check/select the version of Python you are using: VSCode: There is no Pip ... More on stackoverflow.com
🌐 stackoverflow.com
How do I install pip for Vscode on mac?
No offense, but did you google anything? Also try using pip3 instead of pip in the terminal. I think it depends on your OS or Python version. More on reddit.com
🌐 r/vscode
15
0
October 31, 2023
People also ask

Can I install pip using a VSCode extension?
No. Pip is installed with Python, not through VS Code extensions. Extensions can help manage packages, but Python must be installed on your system first.
🌐
tms-outsource.com
tms-outsource.com › home › how to install pip on vscode
How to Install Pip on VSCode - TMS Outsource
Does VSCode come with pip installed?
No. VS Code is a code editor, not a Python distribution. Pip is included with Python 3.4 and later. You must install Python separately, and pip is included automatically.
🌐
tms-outsource.com
tms-outsource.com › home › how to install pip on vscode
How to Install Pip on VSCode - TMS Outsource
How do I upgrade pip in VSCode?
Open the integrated terminal and run the pip upgrade command. Keeping pip updated helps avoid compatibility issues with newer Python packages.
🌐
tms-outsource.com
tms-outsource.com › home › how to install pip on vscode
How to Install Pip on VSCode - TMS Outsource
🌐
YouTube
youtube.com › watch
How to Install PIP in Visual Studio Code (Windows & Mac) [2024] - YouTube
This video is an easy tutorial on how to install PIP in Visual Studio Code (VSCode). I've covered for Windows & Mac both.In this video, I have explained the ...
Published   July 23, 2024
🌐
Visual Studio Code
code.visualstudio.com › docs › python › python-tutorial
Getting Started with Python in VS Code
November 3, 2021 - To install the required packages ... with Anaconda distributions because they include matplotlib already. # macOS python3 -m pip install numpy # Windows (may require elevation) python -m pip install numpy # Linux (Debian) apt-get ...
🌐
TMS Outsource
tms-outsource.com › home › how to install pip on vscode
How to Install Pip on VSCode - TMS Outsource
December 11, 2025 - Tell VSCode which Python interpreter ... installation to go to the wrong environment. Press Ctrl+Shift+P (Windows/Linux) or Cmd+Shift+P (macOS)...
Find elsewhere
🌐
Web Dev Wizard
webdevwizardyt.com › home › vs code tips & tricks
How to Install Pip in Visual Studio Code: A Step-by-Step Guide - Web Dev Wizard
October 8, 2025 - Select the appropriate installer for your operating system (e.g., Windows, macOS, Linux). Download the installer and run it. Follow the installation wizard instructions to install Python on your computer.
🌐
Quora
quora.com › Which-pip-command-can-I-use-to-install-Python-packages-in-VS-Code
Which pip command can I use to install Python packages in VS Code? - Quora
To get this in VS Code, go to the “Terminal” option in the top bar, and then click “New Terminal”. You may need to use “pip3” instead of “pip”, so if pip doesn’t work give pip3 a shot.
🌐
YouTube
youtube.com › watch
How to Setup PIP in VS Code to Install Python Packages [2024] - YouTube
In this video, I'll show you how you can install and setup PIP in vscode so that you can install python packages.We will first install PIP and then add PIP t...
Published   July 23, 2024
🌐
YouTube
youtube.com › codesolve
install pip in vscode mac - YouTube
Download this code from https://codegive.com Certainly! Below is an informative tutorial on how to install pip in Visual Studio Code on a Mac, along with cod...
Published   January 2, 2024
Views   42
🌐
YouTube
youtube.com › watch
How to Install PIP in Visual Studio Code | PIP in VS Code (2025) - YouTube
In this video I'll show you how to install pip in visual studio code, so that you can install python packages in VS Code using PIP. If you're struggling to s...
Published   January 14, 2025
🌐
AlfinTech Computer
alfintechcomputer.com › home › mac › install pip macos vscode instructions
Install PIP macOS VSCode Instructions | AlfinTech Computer
December 5, 2025 - The terminal opened fine, pip was present and he could pip install autopep8 in the terminal which opened in VSCOde. However, when he tried running the Format Document command, he got the same errors where autopep8 and pip are not available in the environment. If you have the same issue as someone like above, you are able to try to fix it by performing the methods which are given by others on that forum. If you are on MacOS...
🌐
Hashnode
emminex.hashnode.dev › how-to-install-python-libraries-in-visual-studio-code
Install Python Libraries in VS Code Like a Pro: Easy Beginner's Guide
October 16, 2025 - Learn how to easily install and manage Python libraries in Visual Studio Code. This beginner-friendly guide covers virtual environments, pip commands, etc.
🌐
My Tec Bits
mytecbits.com › home › internet & web dev. › python › installing python packages for visual studio code on macos
Installing Python Packages For Visual Studio Code On macOS | My Tec Bits
September 7, 2019 - You will be able to get the result without any error. In the workspace, where virtual environment is already available you can run the comment python3 -m pip install <package-name> for installing more packages as needed.
🌐
Medium
samuelodekunle.medium.com › setting-up-vs-code-for-python-development-on-a-mac-a-step-by-step-guide-db583b7e9915
Setting Up VS Code for Python Development on a Mac: A Step-by-Step Guide | by Samuel Odekunle | Medium
November 25, 2024 - Create a virtual environment: python3 -m venv .venv (replace .venv with your preferred name). Activate the virtual environment: source .venv/bin/activate ... Use pip, the Python package installer, to install the required libraries for your project.
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-install-pip-in-macos
How To Install PIP in macOS - GeeksforGeeks
July 12, 2025 - Learn how to install and use PIP on macOS with this step-by-step guide. Troubleshoot common errors, upgrade PIP and install Python packages easily on macOS.
🌐
Install Manual
installmanual.com › home › appliance installations › how to use pip install in vscode: a step-by-step guide
How to Use Pip Install in VSCode: A Step-by-Step Guide
Virtual environments are the recommended way to isolate dependencies per project. Create one with python -m venv env, then activate it: on Windows, env\Scripts\activate; on macOS/Linux, source env/bin/activate. When the environment is active, any pip install commands will affect only that environment.
Published   February 16, 2026
🌐
Brainly
brainly.com › computers and technology › high school › how do you install python packages in visual studio code?
[FREE] How do you install Python packages in Visual Studio Code? - brainly.com
November 19, 2023 - Installing Python packages in Visual Studio Code can be done using the integrated terminal with the command 'pip install package_name' or by using the command palette with 'Python: Run Pip Install'.