-
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
New shells activate conda base environment before activating python.pythonPath conda environment #12379
Comments
Yes, the extension sends that. It's because we have noticed some conda versions that the activation doesn't work unless base is activated first. Or if user has not configured his shell manually, this step does it for him. |
Perhaps #8870 might be of interest to you, if so, please upvote the issue. |
Ah I see, thanks for the context @karrtikr. It's not necessarily causing me problems, just unexpected behavior to me. I have upvoted the issue you linked. |
@karrtikr when activating base is needed to make an environment works, it tipycally means one has a broken conda setup in the first place. Regardless of that, "source /bin/activate" has been deprecated by conda (see this post from anaconda's blog) and one should use "conda activate base" instead. |
@lucacerone That may very well be true, however, we try our best to support all kinds of scenario. We've received complaints on our side which is why we went with that just to be safe. |
Update: I posted much of this comment as a general feature request here. Please upvote that if you would also like to be able to disable the automatic running of these two lines of code in every new terminal in a VS workspace that has Python extension activated. I just started using VS Code to integrate my R and Python scripts in a single workspace. This "feature" of the Python extension is really annoying... Okay, I understand why you may have built something that runs I do not need/want these commands to run automatically if I simply open an R terminal, a bash terminal, or some other terminal... Yet, in VS workspaces where the VS Code extension has been activated, these commands are sent every single time a new terminal is open. Why? Thank you! |
Upvoted. |
Environment data
"python.jediEnabled"
set to; more info How to update the language server to the latest stable version #3977): Jedipython.languageServer
setting: MicrosoftExpected behaviour
In my workspace settings I have set:
"python.pythonPath": "/Users/me@home.com/opt/anaconda3/envs/pytorch/bin/python"
So I would expect every time I open a new shell in VS Code the shell runs
conda activate pytorch
.Actual behaviour
Each time I open a new shell in the workspace I get this output (before running any commands manually):
Is there a reason the shell is running
source /Users/me@home.com/opt/anaconda3/bin/activate
before activating the pytorch environment? In my~/.condarc
I haveauto_activate_base: false
so I'm not sure why the base conda environment is being activated at all.Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)The text was updated successfully, but these errors were encountered: