Skip to content
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 environments detected as Python installs (not conda) when conda not on PATH. #1944

Closed
brettcannon opened this issue Jun 12, 2018 · 5 comments · Fixed by #2605
Closed
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority

Comments

@brettcannon
Copy link
Member

If you install e.g. miniconda3 and leave it off your PATH as the installer says to, then any created conda environments show up as a Python install and not a conda environment.

@brettcannon brettcannon added bug Issue identified by VS Code Team member as probable bug needs PR labels Jun 12, 2018
@karosc
Copy link

karosc commented Jul 17, 2018

I have the same problem. A work around is to edit C:\Program Files\Microsoft VS Code\bin\code.cmd and launch code using that.

  1. open C:\Program Files\Microsoft VS Code\bin\code.cmd with a text editor like notepad++
  2. at the top of the file add line with set PATH={insert anaconda paths here};%PATH%
  3. point your VS Code shortcuts to C:\Program Files\Microsoft VS Code\bin\code.cmd instead of C:\Program Files\Microsoft VS Code\Code.exe
  4. FOR THE BRAVE ONLY (to correct the shortcut in your windows context menu)
    a. run regedit
    b. navigate to HKEY_CLASSES_ROOT\*\shell\VSCode\command
    c. In that entry you will see a key with the string"C:\Program Files\Microsoft VS Code\Code.exe" "%1"......edit the string to be "C:\Program Files\Microsoft VS Code\bin\code.cmd" "%1"

This way every time you launch VS Code, the PATH is edited for that instance of the program only without touching your global PATH.

@brettcannon
Copy link
Member Author

Will probably be fixed as part of #2266 .

@brettcannon brettcannon added the important Issue identified as high-priority label Aug 2, 2018
@ericsnowcurrently ericsnowcurrently changed the title Conda environments detected as Python installs when conda not on PATH Conda environments detected as Python installs (not conda) when conda not on PATH. Sep 6, 2018
@ericsnowcurrently ericsnowcurrently self-assigned this Sep 6, 2018
@brettcannon brettcannon added this to the September 2018 Sprint 1 milestone Sep 6, 2018
@ericsnowcurrently
Copy link
Member

FYI, Anaconda stopped adding itself to PATH in 4.4.0;

@DonJayamanne
Copy link

DonJayamanne commented Sep 13, 2018

@ericsnowcurrently
Here's what'll need to be done:

  • Add setting for conda path in settings.json
    You need to add a setting in IPythonSettings and make necessary changes to configSettings.ts to read the value and assign it
  • Modify getCondaFileImpl of condaServie.ts to use the value provided in the above IPythonSettings for conda.

@DonJayamanne
Copy link

@ericsnowcurrently
You failed to make the following changes:

You need to add a setting in IPythonSettings and make necessary changes to configSettings.ts to read the value and assign it

@lock lock bot locked as resolved and limited conversation to collaborators Oct 24, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority
Projects
None yet
4 participants