3

For a particular machine learning project, I needed to install Python 3.5 instead of the typical Python 3.6 I usually use. I set up my path variables such that within the command line or PowerShell, python launches my typical Anaconda Python 3.6, but python35 launches my Python 3.5 edition.

My favorite text editor / lightweight IDE to use is Visual Studio Code. However, when I use Visual Studio Code's integrated terminal to execute my Python scripts, it's unable to find my 3.5 edition.

Using Windows Powershell, things work completely fine: enter image description here

However, when I attempt to access Python 3.5 within my Visual Studio Code PowerShell terminal, it can't recognize python35: enter image description here

I've Google searched my the error ("the term ... is not recognized as the name of a cmdlet,..."), but every post I found on SO related to this issue (such as this one) has been about setting environment variables. I don't think this is the case here, since my normal PowerShell is able to recognize both python and python35. My suspicion is this has to do with the internal workings of the integrated terminal feature in Visual Studio Code, but I don't know enough to understand what to do next.

Does anyone know why this is happening? It's not a mission-critical issue, since I just pull up my PowerShell to execute my Python scripts, but I'd like to solve it for curiosity's sake.

Yu Chen
  • 6,540
  • 6
  • 51
  • 86
  • 1
    Compare `$env:PATH` in both environments. The VSCode PowerShell extension doesn't load your regular `$PROFILE`. – mklement0 Sep 05 '17 at 03:10
  • Did you ever solve this? I am having the same issue - although with Jekyll and not Python. My Path variables are the same. – rorymadden Dec 30 '17 at 15:59
  • No, I didn't bother since an easy fix was just switching to my `cmd` or moving to PyCharm. But I think @mklement0 is pretty spot on, although if you say your path variables are the same for both then I'm stumped. – Yu Chen Dec 31 '17 at 03:50
  • @rorymadden, maybe it is obvious but in my case the key part was noticing the little yellow warning sign at the status bar (bottom) of VSC which I clicked and then selected **which** python I would like to use out of two. After then everything worked fine. – astrowalker Apr 18 '18 at 07:48

0 Answers0