Difficult/unintuitive to modify individual VS Code & ext. settings: WSL+Anaconda issue - conda: command not found #61548
Labels
*caused-by-extension
Issue identified to be caused by an extension
terminal
General terminal issues that don't fall under another label
Issue Type: Feature Request
I try to use the WSL terminal integrated into VS Code.
I'm filing this as a feature request, whereas I intend it as constructive criticism towards some specific elements of the UI (graphical and otherwise), and I would possibly hope for some helpful pointers in return.
Problem as in action, until today:
Until today, every time I open new terminal, some process will be trying to launch a script from a preconfigured path to Anaconda in
..\ProgramData\et cetera
, into the current WSL.WSL would then interpret this command and fail, considering that the preconfigured path was full of backslashes, which it would read as escape characters; certainly not interpreting it as the intended command: "activate conda".
This error message's behaviour persisted even when I tried to choose either of my python interpreters:
I've had to spend good hours for days now, towards figuring out even why this is/which settings does this/where can I modify them.
Reflections, as in: "Letting you understand the circumstances of my problems, and bullet pointing my suggestions for you" (it may be a wall of text for you, but it might also be valuable for you to know how your interface is perceived from even a single user's experience)
I am a newcomer to VS Code, having been using Sublime Text for years (simply decided to try out VS Code because it was bundled with Anaconda, and I'm very pleased overall). However, to me the problem here is not a lack of implementation on VS Code's part, but to provide a relatively intuitive way of leading the user towards the correct settings involved in this. As requested in Globally WSL support , there should be an over-arching portion of the settings concerning how the integrated terminal and the extensions are directed to a specific command terminal, be it bash or cmd.
I'm also perplexed to the contrast of how well-documented every single feature of VS Code is - except for how to manually edit individual settings for individual extensions (for, after all, my issue could stem from one of my extensions!). I've also google this, but I suspect that the last few years of sifting through StackExchange- and Numpy sites, by way of google, is polluting the results somewhat: only to say that I've never had these specific problems before. In any case: surely, these extensions have their own settings that should be configurable, but I've looked through UI elements of VS Code that would otherwise be logical places to find these configurables, or even through the
settings.json
that I could find: and I couldn't find any settings towards modifying extensions, nor anything that lead toward an Anaconda-launchable script's path related toProgramData
.So, as far as I can tell, it seems that the user is intended to add their extension-specific settings' modifications into
settings.json
(as modifyable by the user). Am I correct?In case I am, how about the same solution as how one would edit the
settings.json
, i.e.:settings.json
file that is intended for the user.I did find
launch.json
by accident in the settings-GUI, and could not remember how to get back to it, until I today found it in the drop-down menu from "Debug", called "Add configuration" - not at all my first thought, when I'm "merely" looking for how the 'integrated terminal' works. So then, finally, I thought; that these were settings that might have something to do with the that issue I began with, but it became clear to me that the file didn't mention Anaconda, nor did it refer to a pre-configured path related to the Windows-folderProgramData
: so again, a dead end.My reason for not-yet-disabling my extensions, was that when I even booted up VS Code for the very first time, it was to open a python script, and several things immediately installed by their own - and I was also fairly quick to configure VS Code to utilize WSL, too: And with these circumstances, along with that I've always seen that Anaconda-related error message when opening the terminal, led me to believe that the problem was fairly ingrained in VS Code's interpretation of WSL, and not to do with the extensions in themselves - maybe even in the fact that installing VS Code from Anaconda ingrained Anaconda itself into VS Code; and I don't consider Anaconda itself to be an extension to VS Code.
As it turns out, I believe there was some truth to my hunch: the error message finally stopped when I created a
~/.bash_profile
-file in WSL (...didn't need one until now!), wherein I sourced the my WSL's~/.bashrc
file - into which I also added the linesource ~/Anaconda2/etc/profile.d/conda.sh
. Seeing as I mostly install Anaconda from convention, merely for acquisition of the collection of python packages found within, this was not my first thought, and thus I give cudos tosource activate
is broken in 4.4 for zsh .At this point I went back to VS Code settings, and made sure that both the
pythonPath
and thecondaPath
refer to their installations within the WSL environment:"python.pythonPath": "~/Anaconda2/bin/python"
and"python.condaPath": "~/Anaconda2/bin/conda"
, respectively. Opening the terminal now only shows me what I've myself set the~/.bashrc
to display upon startup; no error messages.I still have no idea if there's some part of Anaconda that has ingrained itself into VS Code, and is actively trying to be able to activate in the background without my knowing, because that is exactly how it seems like they are doing:
That the error message which I had from the beginning, was simply Anaconda from the Windows side (and not inside WSL) that has somehow configured VS Code into checking any terminal environment that opens, if there is Anaconda inside - not even running Anaconda, just checking if Anaconda is potentially there to be run.
And I say "seems", because I still cannot find any settings, modified or not, that tells any integrated terminal to do this. At least now, if it's still doing it, then thankfully it's keeping it to itself.
VS Code version: Code 1.28.2 (7f3ce96, 2018-10-17T00:23:51.859Z)
OS version: Windows_NT x64 10.0.17134
The text was updated successfully, but these errors were encountered: