You are not logged in.

#1 2015-02-01 20:12:33

wil93
Member
From: Italy
Registered: 2013-09-15
Posts: 72

[SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

From https://docs.python.org/3/installing/ you can read:

  • pip is the preferred installer program. Starting with Python 3.4, it is included by default with the Python binary installers.

  • pyvenv is the standard tool for creating virtual environments, and has been part of Python since Python 3.3.

In fact, pyvenv is owned by python:

$ pacman -Qo `which pyvenv`
/usr/bin/pyvenv is owned by python 3.4.2-2

The pip command, though, has its own package:

$ pacman -Qo `which pip3`
/usr/bin/pip3 is owned by python-pip 6.0.7-1

Why is that?

Last edited by wil93 (2015-02-02 19:30:05)

Offline

#2 2015-02-02 09:43:55

Erhan
Member
Registered: 2012-12-05
Posts: 12

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

What about pip for python 2.x. Maybe that package would still be needed for that case but yes: For 3.4 it would not be needed anymore. I think this case will change within a given time.

Offline

#3 2015-02-02 09:59:44

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

I am not sure I understand the problem. pyenv is indeed the preferred method  to create virtual environment and will include pip in the virtual environment. pip is used to install python packages directly from python. It may not be a very good idea to install python packages directly without a virtual environment, because it will conflicts with archlinux package and you risk to break everything if you upgrade python. Anyway some people may want to do that for some reason, this is why pip is packaged.

Offline

#4 2015-02-02 10:06:28

progandy
Member
Registered: 2012-05-17
Posts: 5,317

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

wil93 wrote:

...
In fact, pyvenv is owned by python:
...
The pip command, though, has its own package:
...
Why is that?

pip is included with the official binary installers, it is not part of the python source code.
pyvenv is part of the python source code.

arch does not use an official binary, but compiles it from source, so you have one package for python (including venv) and another package for pip.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' | alias ENGLISH='LANG=C.UTF-8 ' |

Offline

#5 2015-02-02 12:26:34

wil93
Member
From: Italy
Registered: 2013-09-15
Posts: 72

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

olive wrote:

I am not sure I understand the problem. pyenv is indeed the preferred method  to create virtual environment and will include pip in the virtual environment. pip is used to install python packages directly from python. It may not be a very good idea to install python packages directly without a virtual environment, because it will conflicts with archlinux package and you risk to break everything if you upgrade python. Anyway some people may want to do that for some reason, this is why pip is packaged.

Whether you use a virtual environment or not, you still have to issue a "pip install package" command. To do this, currently, you must install the python-pip package. Here we can read:

Python 2.7.9 and later (on the python2 series), and Python 3.4 and later include pip by default [1], so you may have pip already.

so I'm just wondering why the default python package doesn't include pip.

progandy wrote:

arch does not use an official binary, but compiles it from source, so you have one package for python (including venv) and another package for pip.

Thanks, in that case: wouldn't it be suitable to update the python package changing the python-pip dependency from "optional" to "required"? I think it would be suitable, but it wouldn't be a "beautiful" soultion.

Ruby, for example, provides its own package manager:

$ pacman -Qo `which gem`
/usr/bin/gem is owned by ruby 2.2.0-1

Same story for Nodejs:

$ pacman -Qo `which npm`
/usr/bin/npm is owned by nodejs 0.10.36-2

I wonder: will pip eventually become part of python's source code?

Offline

#6 2015-02-02 13:00:49

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,459
Website

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

wil93 wrote:

Thanks, in that case: wouldn't it be suitable to update the python package changing the python-pip dependency from "optional" to "required"? I think it would be suitable, but it wouldn't be a "beautiful" soultion.

What?  No.  Please don't.  For me, python is required for the following: namcap  pyalpm  python-pyelftools  ranger  reflector.  All of these are just fine without pip.  I have no use for pip.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#7 2015-02-02 13:06:59

wil93
Member
From: Italy
Registered: 2013-09-15
Posts: 72

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

Trilby wrote:

I have no use for pip.

That's not the point... Going by that logic we should split up "gem" from ruby and "npm" from nodejs. When python didn't have an official package manager we used (unofficially) pip. Now it is official, so it should be present by default.

Also, I don't think that adding 5,66 MiB to the current 87,41 MiB will hurt tongue

Last edited by wil93 (2015-02-02 13:07:09)

Offline

#8 2015-02-02 13:57:17

Raynman
Member
Registered: 2011-10-22
Posts: 1,539

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

Merging pip/setuptools into the python package seems to have been considered when 3.4 came out [1], but in the end they were kept as separate packages. I'd suggest contacting the maintainer for more background.

[1] https://projects.archlinux.org/svntogit … fba70dc521

Offline

#9 2015-02-02 14:03:18

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 30,459
Website

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

wil93 wrote:

Also, I don't think that adding 5,66 MiB to the current 87,41 MiB will hurt tongue

No, and this is a good argument for including it in the python package.  But if they remain separate packages, I see no need for it to be a hard dependency.  Python runs just fine without pip.  Hard dependencies should be actually required, not just optional bits that some users would use.


"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman

Offline

#10 2015-02-02 15:50:48

clfarron4
Member
From: London, UK
Registered: 2013-06-28
Posts: 2,174
Website

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

Trilby wrote:

Hard dependencies should be actually required, not just optional bits that some users would use.

Whilst you can argue a simplicity/upstream made the change argument, I support @Trilby's argument from my experience of playing around with PKGBUILDs.


Claire is fine.
Problems? I have dysgraphia, so clear and concise please.
My public GPG key for package signing
My x86_64 package repository

Offline

#11 2015-02-02 16:23:36

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

wil93 wrote:

Whether you use a virtual environment or not, you still have to issue a "pip install package" command. To do this, currently, you must install the python-pip package. Here we can read:

When you setup the virtualenv, virtualenv will download and install pip automatically in the virtual environment, so I think you don't need the python-pip package.

Last edited by olive (2015-02-02 16:23:51)

Offline

#12 2015-02-02 18:28:06

wil93
Member
From: Italy
Registered: 2013-09-15
Posts: 72

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

olive wrote:

When you setup the virtualenv, virtualenv will download and install pip automatically in the virtual environment, so I think you don't need the python-pip package.

Thanks, I didn't know that (I assumed that pyvenv copied pip from its system folder).

Actually, I investigated a bit, and pyvenv will not download it (from internet) but will just "unpack it" wink
This is the "packed" wheel file, and it's (correctly) owned by the python package smile

$ pacman -Qo /usr/lib/python3.4/ensurepip/_bundled/pip-1.5.6-py2.py3-none-any.whl
/usr/lib/python3.4/ensurepip/_bundled/pip-1.5.6-py2.py3-none-any.whl is owned by python 3.4.2-2

(setuptools is also included, in the same system folder).

So, to sum up the discussion, pip is actually included in the python package smile

Still, sometimes it would be useful to have it also outside virtual environments, but for most use-cases this is just enough. Thanks @olive, and thanks everyone smile

EDIT: I don't have enough characters available to mark this topic as "[SOLVED]", can some moderator handle this? tongue

Last edited by wil93 (2015-02-02 18:30:53)

Offline

#13 2015-02-02 19:10:52

olive
Member
From: Belgium
Registered: 2008-06-22
Posts: 1,490

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

wil93 wrote:

EDIT: I don't have enough characters available to mark this topic as "[SOLVED]", can some moderator handle this? tongue

Edit your first post and abbreviate the subject to use less characters, then mak it as [SOLVED]

Last edited by olive (2015-02-02 19:11:14)

Offline

#14 2015-02-02 22:19:39

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 713

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

wil93 wrote:

So, to sum up the discussion, pip is actually included in the python package smile

Still, sometimes it would be useful to have it also outside virtual environments, but for most use-cases this is just enough. Thanks @olive, and thanks everyone smile

The official python response is that users should not really be using pip outside of a virtual env anyhow as you should not install into the global packages. So python 3.4 installs pip in a virtual env under <env>/bin/pip (i.e. by pyvenv - the new virtualenv command) but does not include a /usr/bin/pip.

If you really want to use official python 3.4 pip globally you don't have to install python-pip anyhow, you can just type "python -m pip <pip-commands ..>". Alias that command to pip if you want.

Last edited by bulletmark (2015-02-02 22:20:02)

Online

#15 2015-02-02 22:35:20

wil93
Member
From: Italy
Registered: 2013-09-15
Posts: 72

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

bulletmark wrote:

If you really want to use official python 3.4 pip globally you don't have to install python-pip anyhow, you can just type "python -m pip <pip-commands ..>". Alias that command to pip if you want.

Uhm, but since pip it's not installed (it's only "present" as a .whl file in the system directory) that should not work. In fact:

$ python -m pip
/usr/bin/python: No module named pip

I'd say that python-pip is the only way to use pip globally.

Offline

#16 2015-02-02 22:47:03

bulletmark
Member
From: Brisbane, Australia
Registered: 2013-10-22
Posts: 713

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

I don't have python-pip installed, but python -m pip works for me?

Edit: in fact, the official python 3.4 docs say to use "python -m pip". See https://docs.python.org/3/installing/.

Last edited by bulletmark (2015-02-02 22:49:11)

Online

#17 2015-02-02 22:57:57

wil93
Member
From: Italy
Registered: 2013-09-15
Posts: 72

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

bulletmark wrote:

I don't have python-pip installed, but python -m pip works for me?

That's weird... for me, that command works only if python-pip is installed. I am testing with both python2-pip and python-pip uninstalled and it doesn't work.

EDIT: You probably have this folder hanging around (not belonging to a package) for some reason: /usr/lib/python3.4/site-packages/pip-6.0.7-py3.4.egg-info (maybe with different version numbers). Could you try issuing this command?

$ pacman -Qo /usr/lib/python3.4/site-packages/pip-6.0.7-py3.4.egg-info

on my system (when the folder exists) it's owned by python-pip.

Last edited by wil93 (2015-02-02 23:06:46)

Offline

#18 2015-02-02 23:02:40

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,548
Website

Re: [SOLVED] Why 'python-pip' still needed after 'python' has reached 3.4?

bulletmark wrote:

I don't have python-pip installed, but python -m pip works for me?

Edit: in fact, the official python 3.4 docs say to use "python -m pip". See https://docs.python.org/3/installing/.

Sure, but take a look at the PKGBUILD, pip (and setuptools) are explicitly disabled in Arch's python package:
https://projects.archlinux.org/svntogit … python#n48


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

Board footer

Powered by FluxBB