10

I have python 3.6 installed, I have a python extension installed on Visual Studio code but I still can't use pip on Visual Studio code. It says it is not a recognised command. Any help please?

Update: I tried installing pip manually but a file in python2.7 keeps stopping. What's bothersome is that I uninstalled python 2.7 ages ago and I've currently removed every folder with it but python-V still says I have python2.7.6 installed.

I'm on windows 10

Drew U
  • 335
  • 2
  • 6
  • 17
  • You dont specify which OS you are on, but if you are on Windows, see what the Path values for Python is . If it points to Python 2.7 location , please replace it with the folder that points to your current installation.. – Gagan Feb 26 '17 at 02:42
  • Here is a SO link that might help you , if you are on windows : http://stackoverflow.com/questions/3701646/how-to-add-to-the-pythonpath-in-windows-7 – Gagan Feb 26 '17 at 02:46
  • I already checked the path, there isn't anything with python is it. Is that a problem? Also I'm on windows sorry, I'll specify it now – Drew U Feb 26 '17 at 02:54
  • I am pretty sure if you add your ( Python 3.6 installation ) location to the system path it should be resolved. – Gagan Feb 26 '17 at 02:56
  • @Gagan okay, I'll do that now. Thank you – Drew U Feb 26 '17 at 03:00
  • You might want to restart VS code after having changed the path. – Gagan Feb 26 '17 at 03:01
  • So I changed the path and now VS Code is using python3.6 which is great but it still doesn't recognise pip as a command and my Bash Shell is still using the python 2.7.6 version – Drew U Feb 26 '17 at 03:22
  • have you tried running pip from outside of vscocde using 3.6 ? – Gagan Feb 26 '17 at 03:24
  • I was going to use my bash shell but it's still using the uninstalled version of python2.6.7. – Drew U Feb 26 '17 at 03:25
  • Okay. I got the VScode to use pip by adding the pip path to PATH. I'll fix the bash shell later I guess. Thank you for the help – Drew U Feb 26 '17 at 03:26
  • If i create a new answer , would you be kind enough to accept that as an answer .. it would be helpful ! - thanks – Gagan Feb 26 '17 at 03:29
  • Thanks :) .. much appreciated! – Gagan Feb 26 '17 at 04:28

2 Answers2

2

I am pretty sure your problems of VSCode not finding the correct version of Python will be resolved if you add your ( Python 3.6 installation ) location to the system path.

Gagan
  • 4,736
  • 13
  • 48
  • 78
0

I found some solution on this website:

https://pip.pypa.io/en/stable/installing/

If you use Visual Studio Code, you can type the following command:

   C:\> py -m pip

If everything is alright, you should see the list of commands, which you can use. They are listed in your terminal, as per below.

enter image description here

I also would advise you to check/select the version of Python you are using:

VSCode: There is no Pip installer available in the selected environment

MKR
  • 743
  • 1
  • 8
  • 19