LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware
User Name
Password
Slackware This Forum is for the discussion of Slackware Linux.

Notices


Reply
  Search this Thread
Old 02-01-2021, 04:39 PM   #1
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
-current pip and pip3 what's a difference?


I was sure pip command refers to Python 2.7 version while pip3 to Python 3.x, but it appeared I was wrong
Code:
bash-5.1$ pip --version
pip 20.3.3 from /usr/lib64/python3.9/site-packages/pip (python 3.9)
bash-5.1$ pip3 --version
pip 20.3.3 from /usr/lib64/python3.9/site-packages/pip (python 3.9)
bash-5.1$ ls -l `which pip`
-rwxr-xr-x 1 root root 941 Jan 20 23:56 /usr/bin/pip
bash-5.1$ ls -l `which pip3`
-rwxr-xr-x 1 root root 943 Jan 20 23:56 /usr/bin/pip3
they are both executable, both refer to Python 3.9, but they even different in size.
 
Old 02-01-2021, 04:46 PM   #2
ctrlaltca
Member
 
Registered: May 2019
Location: Italy
Distribution: Slackware
Posts: 333

Rep: Reputation: 389Reputation: 389Reputation: 389Reputation: 389
They are quite the same file, the only difference in size is due to the name of the file itself that is cited inside the script.
You may want to use pip2 for python2.
 
Old 02-01-2021, 05:18 PM   #3
igadoter
Senior Member
 
Registered: Sep 2006
Location: wroclaw, poland
Distribution: many, primary Slackware
Posts: 2,717

Original Poster
Blog Entries: 1

Rep: Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625Reputation: 625
I don't understand this. I mean people using Python know why it has to be like that. I mean propably better question would be are pip and pip3 are the same programs.
 
Old 02-02-2021, 03:00 AM   #4
3rensho
Senior Member
 
Registered: Mar 2008
Location: Deutschland
Distribution: Slackware64-current
Posts: 1,026

Rep: Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618Reputation: 618
If you compare /usr/bin/pip and /usr/bin/pip3 they are identical except it is called pip in /usr/bin/pip and is called pip3 in /usr/bin/pip3.
Attached Thumbnails
Click image for larger version

Name:	pip-pip3.jpeg
Views:	18
Size:	144.1 KB
ID:	35463  

Last edited by 3rensho; 02-02-2021 at 03:04 AM.
 
Old 02-03-2021, 07:53 AM   #5
brobr
Member
 
Registered: Oct 2003
Location: uk
Distribution: Slackware
Posts: 974

Rep: Reputation: 239Reputation: 239Reputation: 239
I guess this change relates to the end-of-line status of python 2; it's no longer seen as the major version on a box. On current, this is python 3 and thus commands as 'pip' will pick up the python 3 version ('pip3'). On many other distributions with python 3 also 'python' refers to python 3 and this also happens in some scripts (calling for python when python3 is intended to be used), that then do not run properly on a pre-current slack-box with python2 as the default python (and normally called by 'python').

Yes it is confusing, join the club..

Last edited by brobr; 02-03-2021 at 07:55 AM.
 
Old 02-03-2021, 11:20 AM   #6
Pithium
Member
 
Registered: Jul 2014
Location: Far side of the Oregon Trail
Distribution: Slackware64 15.0
Posts: 508

Rep: Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586Reputation: 586
Quote:
Originally Posted by igadoter View Post
I don't understand this. I mean people using Python know why it has to be like that. I mean propably better question would be are pip and pip3 are the same programs.

Because there is only pip. The python developers made major changes in Python3 that required syntax changes to be made. You have to remember that Python is a language and so releasing the new version does not immediately obsolete the old version.


The reason pip3 became necessary is because it was necessary for distribution package maintainers to provide both python2 and python3 alongside each other. pip itself is a python program so it needs to be provided in both versions of the language. Now that python2 is officially EOL, pip is a symlink to the supported version by default.
 
1 members found this post helpful.
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
python pip/pip3 app installation error kermitdafrog8 Slackware - ARM 7 07-22-2020 07:35 AM
LXer: pip Uninstall | Uninstall a Package Installed with pip LXer Syndicated Linux News 0 03-01-2018 10:30 AM
[SOLVED] How to install Python "pip"/"pip3" in slackware-arm? njathan Slackware - ARM 5 08-09-2017 12:35 PM
Hello, Bon Jour, Pip Pip SocaSpice LinuxQuestions.org Member Intro 3 11-14-2010 08:22 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Slackware

All times are GMT -5. The time now is 09:28 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration