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.

Recently the debugger has started to activate conda environments which is NOT what I want

See original GitHub issue

@lovettchris commented on Wed Feb 06 2019

Environment data

  • PTVSD version: c:\Users\clovett.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\ptvsd_launcher.py
  • OS and version: Win 10 version 1809, build 1773.292
  • Python version (& distribution if applicable, e.g. Anaconda): Anaconda python 3.6
  • Using VS Code or Visual Studio: VS Code

Actual behavior

Debugging is now doing this, which is NOT what I want, how did this start and how do I disable it? This is what I see in my Terminal output window when trying to debug one of my python scripts:

                   > cd 'd:\temp\gallery\test'; ${env:PYTHONIOENCODING}='UTF-8'; ${env:PYTHONUNBUFFERED}='1'; & 'd:\Continuum\Anaconda3\envs\tensorflow\python.exe' 'c:\Users\clovett\.vscode\extensions\ms-python.python-2019.1.0\pythonFiles\ptvsd_launcher.py' '--default' '--client' '--host' 'localhost' '--port' '51001' 'd:\git\ELL\ELL-training\Gallery\test_models.py' '--path' 'd:\temp\gallery' '--target' 'pi3' '--dataset' '\\aifs\datasets\public\ILSVRC2012 (Imagenet)\ilsvrc.json' '--skip_md' '--categories' '\\aifs\datasets\public\ILSVRC2012 (Imagenet)\ilsvrc.txt' '--max_files' '10' '--logfile' 'test.log' '--skip_md'

PS D:\temp\gallery\test> d:/Continuum/Anaconda3/Scripts/activate PS D:\temp\gallery\test> conda activate tensorflow

Expected behavior

Do not attempt to auto activate a conda environment

Steps to reproduce:

Not sure.


@karthiknadig commented on Wed Feb 06 2019

This is the extension activating it. Moving the issue over to extension repo.


@lovettchris commented on Wed Feb 06 2019

What is odd is that when I use the debug console to look at os.get_exec_path() I see this path has been added to the console environment in which I launched VS code. I have no idea how or why it was added:

os.get_exec_path()
...
00:'D:\\Continuum\\Anaconda3\\envs\\tensorflow\\Library\\bin'

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
lovettchriscommented, Feb 6, 2019

Ok, turning off “python.terminal.activateEnvironment” is what I needed thanks. You can close this now.

0reactions
DonJayamannecommented, Feb 6, 2019

Thats too specific to conda. We need to suppport pipenv, pyenv, virtualenv, etc.

Because I often run 2 or 3 different environments throughout my work day…

All i can suggest is setting the interpreter in vsc using Python: Select Interpreter command.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Recently the debugger has started to activate conda ... - GitHub
Yes, I see now that the activation happens before debugging. Oddly, activating back to the conda environment that I want does not fix...
Read more >
Why doesn't VSCode activate conda before starting the ...
Basically we ask VS Code to launch a terminal with the activation commands and then launch the debugger, but the debugger is able...
Read more >
Efficient Way to Activate Conda in VSCode - Medium
Option 2: Run “conda activate <env-name>” in terminal ... The second way is to have manual control of switching the conda environment in...
Read more >
PyCharm - Configure a conda virtual environment - JetBrains
PyCharm supports creating virtual environments for Python with Conda. The following procedure applies to all supported operating systems.
Read more >
Troubleshooting — conda 22.11.1.post16+ce4e810c9 ...
If you are not activating your environments, start with doing that. There's more info at Activating environments. If you are still stuck, you...
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