Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #220844 > unrolled thread

python3 modules -- apt vs pip?

Started byJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
First post2020-04-04 00:20 +0200
Last post2020-04-06 22:30 +0200
Articles 12 — 9 participants

Back to article view | Back to linux.debian.user


Contents

  python3 modules -- apt vs pip? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2020-04-04 00:20 +0200
    Re: python3 modules -- apt vs pip? thierry.leurent <thierry.leurent@asgardian.be> - 2020-04-04 08:00 +0200
    Re: python3 modules -- apt vs pip? Andrei POPESCU <andreimpopescu@gmail.com> - 2020-04-04 08:40 +0200
    Re: python3 modules -- apt vs pip? Nemeth Gyorgy <lists@friczy.net> - 2020-04-04 10:30 +0200
    Re: python3 modules -- apt vs pip? Alex Mestiashvili <amestia@rsh2.donotuse.de> - 2020-04-04 11:10 +0200
      Re: python3 modules -- apt vs pip? Keith Christian <keith1christian@gmail.com> - 2020-04-04 16:40 +0200
      Re: python3 modules -- apt vs pip? Andrei POPESCU <andreimpopescu@gmail.com> - 2020-04-04 18:30 +0200
      Re: python3 modules -- apt vs pip? Joe Pfeiffer <pfeiffer@cs.nmsu.edu> - 2020-04-04 19:20 +0200
      Re: python3 modules -- apt vs pip? Anil F Duggirala <anilduggirala@fastmail.fm> - 2020-04-06 17:20 +0200
        Re: python3 modules -- apt vs pip? Alex Mestiashvili <amestia@rsh2.donotuse.de> - 2020-04-06 21:20 +0200
        When should I install my own language and library versions? Dan Ritter <dsr@randomstring.org> - 2020-04-06 21:40 +0200
          Re: When should I install my own language and library versions? Simeone Dominique <dominique.simeone@yahoo.fr> - 2020-04-06 22:30 +0200

#220844 — python3 modules -- apt vs pip?

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2020-04-04 00:20 +0200
Subjectpython3 modules -- apt vs pip?
Message-ID<zRCPo-Nb-9@gated-at.bofh.it>
I've been using apt (and friends) to maintain my systems, including
python.  Today I discovered the Debian version of the more-itertools
module is on version 4.2.0 and is three years old.  Meanwhile, the
version documented on pypi.org is at version 8.2.0, and has at least one
recipe whose arguments  are in a different order from the Debian
packaged version (grouper, whose order of arguments changed in version
6.0.0).  This causes problems, as you might imagine, with other modules!

So... do people generally use pip to maintain their python libraries,
rather than apt?  What's the recommended best practices here?

[toc] | [next] | [standalone]


#220855

Fromthierry.leurent <thierry.leurent@asgardian.be>
Date2020-04-04 08:00 +0200
Message-ID<zRK0x-54d-1@gated-at.bofh.it>
In reply to#220844

[Multipart message — attachments visible in raw view] — view raw

I always use pip.

________________________________
From: robomod@news.nic.it <robomod@news.nic.it> on behalf of Joe Pfeiffer <pfeiffer@cs.nmsu.edu>
Sent: Friday, April 3, 2020 11:54:31 PM
To: debian-user@lists.debian.org
Subject: python3 modules -- apt vs pip?

I've been using apt (and friends) to maintain my systems, including
python.  Today I discovered the Debian version of the more-itertools
module is on version 4.2.0 and is three years old.  Meanwhile, the
version documented on pypi.org is at version 8.2.0, and has at least one
recipe whose arguments  are in a different order from the Debian
packaged version (grouper, whose order of arguments changed in version
6.0.0).  This causes problems, as you might imagine, with other modules!

So... do people generally use pip to maintain their python libraries,
rather than apt?  What's the recommended best practices here?

[toc] | [prev] | [next] | [standalone]


#220858

FromAndrei POPESCU <andreimpopescu@gmail.com>
Date2020-04-04 08:40 +0200
Message-ID<zRKDf-5w8-3@gated-at.bofh.it>
In reply to#220844

[Multipart message — attachments visible in raw view] — view raw

On Vi, 03 apr 20, 15:54:31, Joe Pfeiffer wrote:
> I've been using apt (and friends) to maintain my systems, including
> python.  Today I discovered the Debian version of the more-itertools
> module is on version 4.2.0 and is three years old.  Meanwhile, the
> version documented on pypi.org is at version 8.2.0, and has at least one
> recipe whose arguments  are in a different order from the Debian
> packaged version (grouper, whose order of arguments changed in version
> 6.0.0).  This causes problems, as you might imagine, with other modules!
> 
> So... do people generally use pip to maintain their python libraries,
> rather than apt?  What's the recommended best practices here?
 
Depends on what you want to achieve. There was a recent discussion 
regarding Ruby gems, the same general principles should apply to Python. 

https://lists.debian.org/debian-user/2020/03/msg00950.html

The methods to have separate Python modules and / or version installed 
might differ.


Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

[toc] | [prev] | [next] | [standalone]


#220862

FromNemeth Gyorgy <lists@friczy.net>
Date2020-04-04 10:30 +0200
Message-ID<zRMlI-6AZ-9@gated-at.bofh.it>
In reply to#220844
2020. 04. 03. 23:54 keltezéssel, Joe Pfeiffer írta:
> I've been using apt (and friends) to maintain my systems, including
> python.  Today I discovered the Debian version of the more-itertools
> module is on version 4.2.0 and is three years old.  Meanwhile, the
> version documented on pypi.org is at version 8.2.0, and has at least one
> recipe whose arguments  are in a different order from the Debian
> packaged version (grouper, whose order of arguments changed in version
> 6.0.0).  This causes problems, as you might imagine, with other modules!
>
> So... do people generally use pip to maintain their python libraries,
> rather than apt?  What's the recommended best practices here?
>
Keep using apt on your system. If you need newer libraries from pip,
create virtual environment.

[toc] | [prev] | [next] | [standalone]


#220865

FromAlex Mestiashvili <amestia@rsh2.donotuse.de>
Date2020-04-04 11:10 +0200
Message-ID<zRMYq-746-11@gated-at.bofh.it>
In reply to#220844
On 4/3/20 11:54 PM, Joe Pfeiffer wrote:
> I've been using apt (and friends) to maintain my systems, including
> python.  Today I discovered the Debian version of the more-itertools
> module is on version 4.2.0 and is three years old.  Meanwhile, the
> version documented on pypi.org is at version 8.2.0, and has at least one
> recipe whose arguments  are in a different order from the Debian
> packaged version (grouper, whose order of arguments changed in version
> 6.0.0).  This causes problems, as you might imagine, with other modules!
> 
> So... do people generally use pip to maintain their python libraries,
> rather than apt?  What's the recommended best practices here?
> 

I'd say the right course of actions would be to open a bug report that
there is a new upstream version available for python3-more-itertools.

In general there are tons of modules which will never be packaged. So
depending on your needs you might need to maintain local modules.

Python provides virtualenv, plus one can install most of the modules
locally with pip3 install --user <blabla> which will install the modules
in ~/.local/lib and tools in ~/.local/bin, so don't forget to add this
to your PATH.

I'd also say that one shouldn't use sudo pip3 since there are high
chances to mess up packages and system.

Also should be careful with names of python packages since mistyping can
lead to installation of malicious software and with sudo it makes it
even more fun - google for "python malicious packages"

[toc] | [prev] | [next] | [standalone]


#220875

FromKeith Christian <keith1christian@gmail.com>
Date2020-04-04 16:40 +0200
Message-ID<zRS7M-1AW-13@gated-at.bofh.it>
In reply to#220865

[Multipart message — attachments visible in raw view] — view raw

TOUCHÉ:  Also should be careful with names of python packages since
mistyping can lead to installation of malicious software and with sudo it
makes it even more fun - google for "python malicious packages"

[toc] | [prev] | [next] | [standalone]


#220886

FromAndrei POPESCU <andreimpopescu@gmail.com>
Date2020-04-04 18:30 +0200
Message-ID<zRTQd-2GF-1@gated-at.bofh.it>
In reply to#220865

[Multipart message — attachments visible in raw view] — view raw

On Sb, 04 apr 20, 11:01:24, Alex Mestiashvili wrote:
> 
> Python provides virtualenv, plus one can install most of the modules
> locally with pip3 install --user <blabla> which will install the modules
> in ~/.local/lib and tools in ~/.local/bin, so don't forget to add this
> to your PATH.

At least in buster (possibly even before) if $HOME/.local/bin exists it 
is automatically added to $PATH by all shells that source ~/.profile 
(this includes bash in Debian's default configuration).

Kind regards,
Andrei
-- 
http://wiki.debian.org/FAQsFromDebianUser

[toc] | [prev] | [next] | [standalone]


#220890

FromJoe Pfeiffer <pfeiffer@cs.nmsu.edu>
Date2020-04-04 19:20 +0200
Message-ID<zRUCB-3cw-1@gated-at.bofh.it>
In reply to#220865
Alex Mestiashvili <amestia@rsh2.donotuse.de> writes:

> On 4/3/20 11:54 PM, Joe Pfeiffer wrote:
>> I've been using apt (and friends) to maintain my systems, including
>> python.  Today I discovered the Debian version of the more-itertools
>> module is on version 4.2.0 and is three years old.  Meanwhile, the
>> version documented on pypi.org is at version 8.2.0, and has at least one
>> recipe whose arguments  are in a different order from the Debian
>> packaged version (grouper, whose order of arguments changed in version
>> 6.0.0).  This causes problems, as you might imagine, with other modules!
>> 
>> So... do people generally use pip to maintain their python libraries,
>> rather than apt?  What's the recommended best practices here?
>> 
>
> I'd say the right course of actions would be to open a bug report that
> there is a new upstream version available for python3-more-itertools.

Good point -- just did it.

> In general there are tons of modules which will never be packaged. So
> depending on your needs you might need to maintain local modules.
>
> Python provides virtualenv, plus one can install most of the modules
> locally with pip3 install --user <blabla> which will install the modules
> in ~/.local/lib and tools in ~/.local/bin, so don't forget to add this
> to your PATH.
>
> I'd also say that one shouldn't use sudo pip3 since there are high
> chances to mess up packages and system.
>
> Also should be careful with names of python packages since mistyping can
> lead to installation of malicious software and with sudo it makes it
> even more fun - google for "python malicious packages"

Thanks for the warning!

[toc] | [prev] | [next] | [standalone]


#221007

FromAnil F Duggirala <anilduggirala@fastmail.fm>
Date2020-04-06 17:20 +0200
Message-ID<zSBHz-4mh-1@gated-at.bofh.it>
In reply to#220865
> Python provides virtualenv, plus one can install most of the modules
> locally with pip3 install --user <blabla> which will install the
> modules
> in ~/.local/lib and tools in ~/.local/bin, so don't forget to add
> this
> to your PATH.
> 

Could you please explain (to a newbie) exactly what are the advantages
of using the --user option and the possible drawbacks as well? please
Could you tell me why I wouldn't want to use a virtualenv? Is it just
because of the pain of having to activate this virtualenv every time I
want to use those modules? or am I losing any other functionality
provided by my system-wide python?
I am surprised this question was asked 2 days ago, I had the exact same
question today. The numpy module is on version 1.16.2 in the debian
repositories and is on version 1.18.2 in pip.
thank you,

[toc] | [prev] | [next] | [standalone]


#221021

FromAlex Mestiashvili <amestia@rsh2.donotuse.de>
Date2020-04-06 21:20 +0200
Message-ID<zSFrP-6Gf-11@gated-at.bofh.it>
In reply to#221007
On 4/6/20 5:11 PM, Anil F Duggirala wrote:
>> Python provides virtualenv, plus one can install most of the modules
>> locally with pip3 install --user <blabla> which will install the
>> modules
>> in ~/.local/lib and tools in ~/.local/bin, so don't forget to add
>> this
>> to your PATH.
>>
> 
> Could you please explain (to a newbie) exactly what are the advantages
> of using the --user option and the possible drawbacks as well? please
> Could you tell me why I wouldn't want to use a virtualenv? Is it just
> because of the pain of having to activate this virtualenv every time I
> want to use those modules? or am I losing any other functionality
> provided by my system-wide python?
> I am surprised this question was asked 2 days ago, I had the exact same
> question today. The numpy module is on version 1.16.2 in the debian
> repositories and is on version 1.18.2 in pip.
> thank you,
> 

virtualenv makes you flexible, you can have completely different
environments isolated from each other. For example Debian Buster comes
with python3.7 and you for whatever reason need python 3.4 or 3.8, or
maybe both because of let's say application requirements. This would
work with different envs.

Installing modules with --user is easier but this way you have 1
environment in your home bound to the system python.

Not every package in Debian can easily be updated. Updating numpy
system-wide most likely will break tons of other software. But the same
applies to pip to some extent, you may have a module requiring an old
numpy which wouldn't work with the new one and so on.

[toc] | [prev] | [next] | [standalone]


#221022 — When should I install my own language and library versions?

FromDan Ritter <dsr@randomstring.org>
Date2020-04-06 21:40 +0200
SubjectWhen should I install my own language and library versions?
Message-ID<zSFLb-6MF-5@gated-at.bofh.it>
In reply to#221007
Generic answer, applying to all languages:

There are people who want a language (and libraries/modules)
installed because something else uses it. Those people should
definitely use the Debian-maintained versions.

Then there are people who want to develop software in a given
language. They can usually start off using the Debian-maintained
versions, but if they are serious about keeping up to date, they
will likely want to use an organized system to install multiple
versions of languages and libraries.

They need these for debugging older versions of their software,
testing out new versions, and ensuring consistency in their
builds.

Each language community tends to have its own tools for that.

-dsr-

[toc] | [prev] | [next] | [standalone]


#221024 — Re: When should I install my own language and library versions?

FromSimeone Dominique <dominique.simeone@yahoo.fr>
Date2020-04-06 22:30 +0200
SubjectRe: When should I install my own language and library versions?
Message-ID<zSGxA-7iO-9@gated-at.bofh.it>
In reply to#221022

[Multipart message — attachments visible in raw view] — view raw

Debian -- File list of package task-esperanto-desktop/buster/all

| 
| 
|  | 
Debian -- File list of package task-esperanto-desktop/buster/all


 |

 |

 |


Friendly


Mr.Dominique Simeone 

    Le lundi 6 avril 2020 à 21:36:23 UTC+2, Dan Ritter <dsr@randomstring.org> a écrit :  
 
 
Generic answer, applying to all languages:

There are people who want a language (and libraries/modules)
installed because something else uses it. Those people should
definitely use the Debian-maintained versions.

Then there are people who want to develop software in a given
language. They can usually start off using the Debian-maintained
versions, but if they are serious about keeping up to date, they
will likely want to use an organized system to install multiple
versions of languages and libraries.

They need these for debugging older versions of their software,
testing out new versions, and ensuring consistency in their
builds.

Each language community tends to have its own tools for that.

-dsr-

  

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.user


csiph-web