anaconda icon indicating copy to clipboard operation
anaconda copied to clipboard

Anaconda, ST3, and WSL python?

Open skjbulcher opened this issue 6 years ago • 5 comments

Is there a way to use WSL's python when configuring the python_enterpreter option? I'm using this for my .anaconda file,

{
  "python_interpreter": "C:\\Windows\\System32\\bash.exe -c /usr/bin/python",
}

but Sublime Text 3 tells me:

image

skjbulcher avatar Jul 16 '18 22:07 skjbulcher

I never used WSL myself but I believe you should just remove all the bash.exe stuff and just leave the path to the python interpreter, try and share the results.

On Mon, Jul 16, 2018, 23:09 skjbulcher [email protected] wrote:

Is there a way to use WSL's python when configuring the python_enterpreter option? I'm using this for my .anaconda file,

{ "python_interpreter": "C:\Windows\System32\bash.exe -c /usr/bin/python", }

but Sublime Text 3 tells me:

[image: image] https://user-images.githubusercontent.com/16672299/42786179-17f2b3a6-890a-11e8-9322-1a62f9d45b6d.png

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/DamnWidget/anaconda/issues/774, or mute the thread https://github.com/notifications/unsubscribe-auth/AAUIJkTfzzSK0iw6OXi6ImxDEQGDKUDTks5uHQ75gaJpZM4VR4M8 .

DamnWidget avatar Jul 17 '18 06:07 DamnWidget

Thanks for the answer DW.

From what I know about WSL your suggestion wouldn't work work; /usr/bin/python isn't a valid Windows path. Even if it was, I doubt the linux python executable is binary compatible with Windows. Nevertheless I did try it, and received the same dialogue box.

With WSL, typing the above command in a Run dialogue prompt will leave you with a python command prompt. My thinking was this would be enough to work. It sounds like there is no support for WSL then?

skjbulcher avatar Jul 17 '18 15:07 skjbulcher

Maybe a BAT file (or whatever is used nowadays in Windows) would work? Honestly I don't know, I don't use Windows.

DamnWidget avatar Jul 17 '18 19:07 DamnWidget

While I am necro-ing this thread, I believe will help other with the same issue: On windows, define the python interpreter as such:

{
        "python_interpreter": "wsl \\\\wsl$\\<distro>\\<path-to-env>\\bin\\python",
}

and replace <distro> / <path-to-env> with your local settings. This ensures interoperability btw. the windows host and the wsl2 environment, and you can set this on a per-project basis (good if project use different python environments).

0kto avatar Aug 11 '21 08:08 0kto

Hi @0kto , which version of anaconda do you use? The above setting does not work for me. It shows that anaconda cannot spawn a process using the given python interpreter.

llan-ml avatar Sep 25 '21 15:09 llan-ml