question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python terminal not activating anaconda prompt

See original GitHub issue

Environment data:

  • VS Code version: 1.56
  • Extension version (available under the Extensions sidebar): v2021.4.765268190
  • OS and version: Windows 10 Pro 10.0.19041
  • Python version (& distribution if applicable, e.g. Anaconda): Python 3.8.8, Anaconda 4.9.2
  • Type of virtual environment used (N/A | venv | virtualenv | conda | …): conda
  • Value of the python.languageServer setting: Pylance

Expected behaviour

Before version 1.56 of vscode when I ran the Run python file in terminal command, the command prompt was opened, then turned into anaconda prompt by running activate.bat, then the environment of the selected python interpreter was activated and finally the script was executed.

Actual behaviour

Opens the command prompt, tries to activate the conda environment without having first activated the anaconda prompt, the command fails, then tries to execute the python file (the command has a & at the beginning) which also fails.

Steps to reproduce:

Just by executing the Run Python File in Terminal command in the command palette after updating vscode to 1.56 before update everything was working fine.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:11 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
KikeSenpaicommented, Jun 8, 2021

I was using anaconda powershell, now I tried on anaconda prompt and it worked, but when I use the run python file in terminal command, it tries to create a new integrated terminal instead of using the current activated one.

Should I open new issue for this?

0reactions
karrtikrcommented, Jun 8, 2021

Nope, that’s expected, as many users do not like us to disrupt their current terminal. It should still be using the activated conda environment.

Glad you got it to work.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Visual Studio Code terminal doesn't activate Conda environment
First, open the Anaconda prompt (How to access Anaconda command prompt in Windows 10 (64-bit)), and type: conda activate tom. To activate your...
Read more >
conda environment activation not working in Python Terminal
Try this: Anaconda prompt and cd to your workspace. Activate the environment using conda activate; Start VS Code using code .
Read more >
terminal not activating the conda environment : PY-23417
When I open the Pycharm terminal window in a project that uses Anaconda, the Windows command prompt is display in the project directory...
Read more >
Getting started with conda
Conda is a powerful package manager and environment manager that you use with command line commands at the Anaconda Prompt for Windows, or...
Read more >
Getting started with Navigator - Anaconda Documentation
Or from the Start menu, search for “Anaconda Prompt” and click to open. In Anaconda Prompt, type in anaconda-navigator and press Enter to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found