-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
conda environment activation not working in Python Terminal #18716
Comments
This is a known issue in VS Code and we're in the process of resolving this. As a temporary solution please change the setting Please let us know how this goes. |
Another alternative is to make sure VS Code is running in a activated environment. Try this:
related #10626 |
Because we have not heard back with the information we requested, we are closing this issue for now. If you are able to provide the info later on then we will be happy to re-open this issue to pick up where we left off. |
We have written the neede
Issue Type: Bug
Behaviour
Expected vs. Actual
I am using conda environments in vscode on a mac (with apple silicon -- but that probably doesn't matter).
I set my python interpreter to the right conda environment, but in the Terminal that environment is not activated, instead the default system python continues to be used.
Steps to reproduce:
conda create --name test python=3.10
VSCode is executing the right conda command to activate the environment:
but somehow it messes up and the path still has the global python ahead of the conda env's python:
which python
to see that the system python is usedecho $PATH
to see that/usr/bin
is before/Users/danielsc/opt/miniconda3/envs/vnext/bin
or whatever your conda envs location isWhen running tests or a .py file, it seems to now be using
conda run
, so everything works fine there:Diagnostic data
python.languageServer
setting: DefaultUser Settings
Extension version: 2022.2.1924087327
VS Code version: Code 1.65.2 (Universal) (c722ca6c7eed3d7987c0d5c3df5c45f6b15e77d1, 2022-03-10T14:33:49.188Z)
OS version: Darwin arm64 21.3.0
Restricted Mode: No
System Info
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
webgl: enabled
webgl2: enabled
A/B Experiments
The text was updated successfully, but these errors were encountered: