Python Interpreter Visual Studio Code
- The standard interpreter used is the first “python” interpreter encountered in the current path. If a specific version is to be used, then configure the path to the python interpreter in the User or Workspace Settings file (settings.json) as follows. Ensure to specify the fully qualified name of the python executable (Mac and Linux supported).
- In order to tell Visual Studio to make use of this new environment, we need to activate the environment in VS Code with the “Python: Select Interpreter” option from the command palette. Open up this command in the palette and select “enter interpreter path” and browse your local system to the “venv” folder in the directory you’ve.
The same python interpreter is used for intellisense, autocomplete, linting, formatting, etc. (everything other than debugging). The standard interpreter used is the first “python” interpreter encountered in the current path.
In this quick blogpost, I will share the steps that you can follow in order to install a Python library using pip through either the Terminal
or a Jupyter Notebook
in Visual Studio Code (VSCode) on a Windows computer.
Pre-requisites
In order to complete the steps of this blogpost, you need to install the following in your windows computer:
Visual Studio Code
: you can find the steps to install it here.Python Extension for Visual Studio Code
: you can find the steps to install it here.Python Interpreter
: you can find the steps to install it here.
Visual Studio Code Anaconda
Installing a Python Library Using the Terminal in VSCode
1) Accessing Visual Studio Code Terminal
- Open VSCode application
- Go to the
Terminal
menu and selectNew Terminal
.
- A new
terminal
(PowerShell based) window is opened.
2) Importing a Python Library
- Run the following command to validate that pip is installed in your computer.
Add Python Interpreter To Visual Studio Code
- Let us say that you want to install
Pandas
Python library. - Run the following command
- Pandas library is now ready to be imported by any python application. You can repeat this process for any Python library.
Installing a Python Library Using a Jupyter Notebook in VSCode
1) Creating a Jupyter Notebook in VSCode
- Create a Jupyter Notebook following the steps of My First Jupyter Notebook on Visual Studio Code (Python kernel)

2) Importing a Python Library
Visual Studio Code Python Interpreter Path

- Run the following command to validate that pip is installed in your computer.
- Let us say that you want to install
Pandas
Python library. - Run the following command.
- Pandas library is now ready to be imported by any python application. You can repeat this process for any Python library.

Subscribe to Open Threat Research Blog
Python Interpreter For Visual Studio Code
Get the latest posts delivered right to your inbox
