python3 modules -- apt vs pip?

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

python3 modules -- apt vs pip?

Joe Pfeiffer-2
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?

Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Thierry Leurent-2

I always use pip.


From: [hidden email] <[hidden email]> on behalf of Joe Pfeiffer <[hidden email]>
Sent: Friday, April 3, 2020 11:54:31 PM
To: [hidden email]
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?

Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Andrei POPESCU-2
In reply to this post by Joe Pfeiffer-2
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

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Nemeth Gyorgy-2
In reply to this post by Joe Pfeiffer-2
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.

Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Alex Mestiashvili-4
In reply to this post by Joe Pfeiffer-2
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"


Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Keith Christian-2

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"


Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Andrei POPESCU-2
In reply to this post by Alex Mestiashvili-4
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

signature.asc (849 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Joe Pfeiffer-2
In reply to this post by Alex Mestiashvili-4
Alex Mestiashvili <[hidden email]> 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!

Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Anil F Duggirala
In reply to this post by Alex Mestiashvili-4
> 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,

Reply | Threaded
Open this post in threaded view
|

Re: python3 modules -- apt vs pip?

Alex Mestiashvili-4
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.



Reply | Threaded
Open this post in threaded view
|

When should I install my own language and library versions?

Dan Ritter-4
In reply to this post by Anil F Duggirala

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-

Reply | Threaded
Open this post in threaded view
|

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

Simeone Dominique
Le lundi 6 avril 2020 à 21:36:23 UTC+2, Dan Ritter <[hidden email]> 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-