environment variables – VSCode Terminal Not Recognizing Python

When using Visual Studio Code, there are two separate Python terminals displayed, and the expected behavior is to have a single Python terminal that activates different Conda environments correctly.

I used to be able to hit shift + enter on anything in python and it would run in the terminal like normal.

I had to restart my computer for an update and ever since then VSCODE no longer runs my base and environment I set up.

Steps to Reproduce:

Open Visual Studio Code and navigate to the integrated terminal.
Notice that two different Python terminals are available, potentially caused by conflicting configurations or extensions.
Attempt to activate the base environment by running conda activate base in the first Python terminal.
Instead of activating the base environment, it incorrectly runs the command conda activate sftpconda.
Switch to the second Python terminal and try to run Python commands, such as import pandas as pd or import os.
Encountered errors indicating that the Python statements are not recognized as valid commands in the terminal.
Expected Behavior: The expectation is to have a single Python terminal that activates the base environment correctly when opened and allows Python commands to be executed without errors. Additionally, the second Python terminal should correctly activate the sftpconda environment instead of running the first line of the current file as a command.

Environment Details:

Operating System: Windows
Visual Studio Code version: [Specify the version]
Python Interpreter: Anaconda3
Conda environments: base and sftpconda
Additional Context:

The settings.json file has been updated to configure the correct paths for Python and the Conda environments.
The terminal.integrated.defaultProfile.windows setting is set to “Command Prompt” to use Command Prompt as the default terminal.

Read more here: Source link