Python Forum
What's the difference between pip and pip3?
Thread Rating:
  • 1 Vote(s) - 4 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What's the difference between pip and pip3?
#5
Test with pip -V or pip2 -V | pip3 -V
It's so simple that if pip3 point to Python 3,then pip3 will install to Python 3.
Linux Mint 19:
tom@tom-VirtualBox:~$ pip2 -V
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)

tom@tom-VirtualBox:~$ pip3 -V
pip 18.0 from /home/tom/.local/lib/python3.6/site-packages/pip (python 3.6)

# Install to Python 2
tom@tom-VirtualBox:~$ pip2 install lxml

# Install to Python 3
tom@tom-VirtualBox:~$ pip3 install --user lxml
Collecting lxm
.... lxml-4.2.5-cp36-cp36m-manylinux1_x86_64.whl
Installing collected packages: lxml
Successfully installed lxml-4.2.5

# Test that it work:
tom@tom-VirtualBox:~$ python3
Python 3.6.5 (default, Apr  1 2018, 05:46:30) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from lxml import etree
>>> etree.__version__
'4.2.5'
For Windows:
Python 3.6/3.7 and pip installation under Windows
Here do pip pip3 and pip3.7 all point to main version in Path.
All other version install can be run/install to with py command.
C:\>pip -V
pip 18.0 from c:\python37\lib\site-packages\pip (python 3.7)

C:\>pip3 -V
pip 18.0 from c:\python37\lib\site-packages\pip (python 3.7)

C:\>pip3.7 -V
pip 18.0 from c:\python37\lib\site-packages\pip (python 3.7)

# Other versions use py
C:\                                                                                                            
λ py -3.6 -V                                                                                                   
Python 3.6.4                                                        
                                                      
C:\                                                                                                            
λ py -2.7 -V                                                                                                   
Python 2.7.9                                                                                                   
                                                                                                                
C:\                                                                                                            
λ # Using pip to install to 2.7                                                                            
λ py -2.7 -m pip install logzero                                                                               
Requirement already satisfied: logzero in c:\python27\lib\site-packages
Reply


Messages In This Thread
RE: What's the difference between pip and pip3? - by snippsat - Sep-13-2018, 06:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  ModuleNotFoundError: No module named '_struct' when starting pip3 yuhuihu 0 2,809 May-05-2022, 04:41 AM
Last Post: yuhuihu
  cmake and pip3 install warnings with python 3.10.2 cyrduf 0 1,840 Feb-26-2022, 01:08 PM
Last Post: cyrduf
  what to do if moudle not in pip3 only in pip2? korenron 22 5,616 Oct-25-2021, 02:35 PM
Last Post: snippsat
  pip3 v21.1.2 SSL Error on RHEL 7 malibu 0 3,067 Jun-01-2021, 03:17 PM
Last Post: malibu
  pip3 install opencv-python fails on 'skbuild' Pedroski55 2 5,621 Sep-15-2020, 11:33 AM
Last Post: snippsat
  Install module with pip3 on a non root user matthewpintor2107 1 2,347 Apr-28-2020, 03:16 PM
Last Post: pyzyx3qwerty
  Wrong pip3 python location or new Version 007fred50 1 3,742 Apr-02-2020, 02:36 PM
Last Post: philgoetz
  Call pip3 from python folder build by me call pip3 from the /usr/bin Suryavarman 3 3,622 Oct-07-2019, 10:23 PM
Last Post: Suryavarman
  Installed Python3.7 from package, trying to run pip3.7 does not work JBristow1729 4 7,468 Aug-11-2019, 08:24 AM
Last Post: michaellossagk
  pip3 install functools failed kintarowonders 1 15,600 Mar-07-2019, 07:56 PM
Last Post: nilamo

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020