You should open the terminal inside the VSCode and install the modules you want. something like👇

if that's not you meant, please let me know.

Answer from Mithilesh on Stack Overflow
🌐
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 ... 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 ...
Discussions

How to install Python packages for a VS Code virtual environment? - Stack Overflow
I successfully created and selected the interpreter in VSCode but I needed to activate it separately in terminal as well using the .\.venv\Scripts\activate command. 2025-05-19T11:00:00.213Z+00:00 ... Opening a new terminal did the trick for me. Thanks. 2025-11-12T12:35:48.613Z+00:00 ... https://packaging.python.org/en/latest/guides/installing... More on stackoverflow.com
🌐 stackoverflow.com
How to install packages on VS Code
Use the terminal window on the bottom of vscode. Don't put the command in your code. pip install numpy or py -m pip install numpy (if that does not work tell us what OS you are using) More on reddit.com
🌐 r/learnpython
11
6
July 6, 2025
How to import library in VS CODE
If you want things installed into your project folder you need to use venv https://docs.python.org/3/library/venv.html However you don't need to do that. pip otherwise installs globally or to your user folder. It ought to be available after pip install despite not being in your working directory. More on reddit.com
🌐 r/learnpython
7
19
November 5, 2021
VSCode isn't Recognizing Python Modules?
Make sure you select the correct Python interpreter/environment (bottom right part of the window). More on reddit.com
🌐 r/vscode
4
4
July 6, 2023
🌐
Reddit
reddit.com › r/learnpython › how to install packages on vs code
r/learnpython on Reddit: How to install packages on VS Code
July 6, 2025 -

Hello! I'm completely brand new to any type of programming and am taking a coding class now to get introduced to it.

As part of my final project I need to make a program with astropy and numpy, but I have no idea how to install it in VS Code, which is what I've been using all semester. Whenever typing the normal install codes others have described in other posts, it gives me a syntax error. I have Python 3.13.3 installed, and that's the version it said it uses.

This whole thing is very confusing for me, so I hope it's not some small stupid mistake I'm making, but any help would be greatly appreciated

🌐
Visual Studio Code
code.visualstudio.com › docs › languages › python
Python in Visual Studio Code
November 3, 2021 - For a quick install, use Python from python.org and install the extension from the Visual Studio Marketplace.
🌐
Hashnode
emminex.hashnode.dev › the tech-thusiast hub › #python › how to install python libraries in visual studio code
Install Python Libraries in VS Code Like a Pro: Easy Beginner's Guide
May 29, 2024 - Head over to the official Python website and download the latest version. Run the installer and follow the on-screen instructions. It’s crucial to check the “Add Python to PATH” box during installation.
🌐
Medium
medium.com › @gbemiadekoya › importing-python-libraries-in-vs-code-e9e7806586a7
Importing Python Libraries in VS Code | by Gbemisola Adekoya | Medium
November 24, 2023 - In your new terminal, type e.g “pip install pandas” or whatever library you want to install and press enter. ... By the time we run our script again, it runs just fine. ... And that’s done!!
🌐
Microsoft Learn
learn.microsoft.com › en-us › visualstudio › python › tutorial-working-with-python-in-visual-studio-step-05-installing-packages
Tutorial Step 5: Install Packages in Python Environment | Microsoft Learn
To resolve the matplotlib import ... global environment: In the Python Environments window, select the default environment for new Python projects, then select Packages (PyPI) in the dropdown menu....
Find elsewhere
🌐
CodeGenes
codegenes.net › blog › how-to-install-python-packages-in-visual-studio-code
How to Install Python Packages in Visual Studio Code — codegenes.net
For example, on Windows, if you created a virtual environment named myenv using venv, you can activate it with the following command: ... Install a Package: Use the pip command to install a package.
🌐
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 - To install Python packages in Visual Studio Code, make sure you have Python and the Python extension installed. Open the integrated terminal and use the command 'pip install package_name' or you can use the command palette.
🌐
CodeRivers
coderivers.org › blog › how-to-install-python-packages-in-visual-studio-code
Installing Python Packages in Visual Studio Code — CodeRivers
Python Extension: Open VS Code and install the "Python" extension from the Extensions sidebar. This extension provides essential Python language support. Python has several package managers, with pip and conda being the most established, and uv emerging as a fast modern alternative.
🌐
DataCamp
datacamp.com › home › tutorials › python › setting up vscode for python: a complete guide
Setting Up VSCode For Python: A Complete Guide | DataCamp
December 3, 2024 - Downloading and installing the latest version of Python is straightforward. Go to Python.org and download the latest version for Windows. The installer is also available for Linux/Unix, macOS, and other platforms. After downloading the installer, install Python with default settings.
🌐
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
Answer: “pip install ” This command needs to be run in a terminal (or command prompt on windows). 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 ...
🌐
YouTube
youtube.com › yeo bro!
How To Install & Use/Import Python Packages in Visual Studio Code - YouTube
This is a simple tutorial on how to install Python packages with pip and using the packages in Visual Studio Code. Commands: python -m pip install --upgrade ...
Published: November 11, 2020
Views: 31
🌐
Medium
medium.com › @faisalkhalidhassan › python-packages-installation-in-vscode-59eab8e2a866
Python Packages Installation in VScode | by Faisal Khalid Hassan | Medium
November 23, 2024 - PIP (Preferred Installer Program): Installing python from python.org enable you to automatically have pip at your disposal, the only thing left for the programmer is to begin the installation using the appropriate command in the terminal of the VScode. pip is the package installer for python, it is a tool to install python packages from the python package index (pypi).
🌐
YouTube
youtube.com › the code city
How to Install Python Packages in Visual Studio Code (2023) - YouTube
In this video, I'll show you how you can Install Python Packages in Visual Studio Code:Install PIP: https://youtu.be/ENHnfQ3cBQMInstall Python: https://youtu...
Published: September 5, 2023
Views: 61K
🌐
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 › watch
Installing a package in Microsoft Visual Studio Code - YouTube
1) Open microsoft visual studio code2) In terminal typepython -m pip install {package_name}where {package name} should be replaced with the proper name. To i...
Published: August 29, 2024