2

I have a variety of different Python versions installed on my Windows system- a 2.7 version, a 3.5 version, and a 3.6 version (there are a bunch of different packages that only work with one version, or are too buggy in the 3.6 version, etc.).

Long story short, I'm trying to keep my all my pips and python.exes in order. I've added my C:/Python35 and C:/Python36 and their Scripts folders to my path, but I also want to make sure that I am using the right pip from my command line (for example, I don't want to pip install pyinstaller to the 3.6 version, since Python 3.6 doesn't play well with pyinstaller as of right now.

I see that inside my Python3x/Scripts/ folder, there are three different pips available: pip, pip3.5, and pip3. enter image description here

So whenever I want to install a module for 3.5, I plan to issue the following command pip3.5 install package_name. Whenever I want to install something for 3.6, I'd use pip or pip3. Seems like a decent enough plan to me.

However, can anyone confirm if the three pips are all the same executable? If so, I'd like to delete pip and pip3 so that I don't accidentally confuse it with my Python 3.6 pip- is this acceptable practice or am I missing something? This SO post provides some insights but doesn't explain why there's multiple pips in the same folder. Also, why are three separate pips provided? Is it simply for convenience from the command line?

Nick T
  • 25,754
  • 12
  • 83
  • 121
Yu Chen
  • 6,540
  • 6
  • 51
  • 86
  • 1
    `where.exe pip` will tell you what one would be executed. You could edit `%PATH%` and double-check with that. It won't change unless `%PATH%` does or the executable (`.exe`, `.com`, `.bat`) disappears (or a new one appears in an earlier path). – Nick T Aug 28 '17 at 22:50

2 Answers2

2

Within the same python installation all the different pip files you find should be the same executable, there is the multiple versions simply to help keep everything in order if there are multiple installs of python on a single computer.

I personally only have the main version of python I use for development set to my PATH variable on my windows laptop and then if I need to do anything to a different python I instead link directly to the necessary file with something like C:\Python36\Scripts\pip3 install natsort but that is simply personal preference and my way of organizing.

If you do have them all on path you can then simply call out pip3.6 install <package name> or whatever python version you are using

stephen
  • 506
  • 1
  • 5
  • 17
1

The difference between them is that each one install the package in its own folder, for example if i type pip install Django, it will be placed for python 2 version, but is a little bit complex when you have multiple version of python3 like you showed, the solution: Don't delete the files and makevirtualenv when you're working, that avoid problems.

This prevents dependency issues with different versions of Python. You also check out virtualenvwrapper which is a convenient way to manage your virtual environments

If you want to manage the version with virtualenv

virtualenv python2_project -p usr/bin/python2.7
virtualenv p35_project -p usr/bin/python3.5
virtualenv p3x_project -p usr/bin/python3.x
Mauricio Cortazar
  • 4,049
  • 2
  • 17
  • 27