You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Extension version (available under the Extensions sidebar): v2020.9.114305
OS and version: Win10-64
Python version (& distribution if applicable, e.g. Anaconda): 3.6.9-64 / miniconda/3-4.7.12
Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda 4.8.3
Relevant/affected Python packages and their versions: XXX
Relevant/affected Python-related VS Code extensions and their versions: XXX
Value of the python.languageServer setting: XXX
[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (python.languageServer: 'Microsoft'), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]
Expected behaviour
I press F5 and start debugging
Debugging start as expected
Actual behaviour
Press F5 and start debugging.
Import numpy fails
miniconda is not started in terminal
Stop debugging
miniconda is activated automatically
switch back to debugged file and press f5
debugging works normally
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Make sure the terminal is closed
Make sure python is not in path
Create a conda env that contains numpy
Create a python file imports numpy
Open it, press F5 and start debugging file
Logs
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
XXX
The text was updated successfully, but these errors were encountered:
This is a known issue with activating conda environments (#5559). This occurs due to some limitation we have with the VS Code terminals and conda. Here is a workaround for this:
Turn off auto activation. To do this, disable these two settings, ideally only for the project you are working on:
Exit VS Code.
Open Anaconda Prompt, navigate to your project.
Activate the environment that you want.
Run code . or code project.code-workspace to launch VS Code.
This will give you an activated environment, and the extension will not have to try and activate every time a terminal is created.
I like your solution, it also fixes issue for me when I try to use pytest inside vscode in a conda env (doesn't work otherwise, crashes at the import of numpy...)
Is it possible to add a setting to vscode that would launch vscode inside an activated environment ?
Sorry if it sound confusing.
I mean a setting that would replace my need to launch vscode from an actived conda env in a terminal with code
Environment data
python.languageServer
setting: XXX[NOTE: If you suspect that your issue is related to the Microsoft Python Language Server (
python.languageServer: 'Microsoft'
), please download our new language server Pylance from the VS Code marketplace to see if that fixes your issue]Expected behaviour
Actual behaviour
Steps to reproduce:
[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: