Pros and cons of Python sources?

Cameron Simpson cs at cskk.id.au
Sun Nov 26 18:09:02 EST 2017


On 26Nov2017 10:00, nospam.Martin Schöön <martin.schoon at gmail.com> wrote:
>Den 2017-11-26 skrev Cameron Simpson <cs at cskk.id.au>:
>> On 25Nov2017 08:34, rusi <rustompmody at gmail.com> wrote:
>>>On Saturday, November 25, 2017 at 9:45:07 PM UTC+5:30, Michael Torrie wrote:
>>>> The problem with mixing repository-installed packages with pip-installed
>>>> packages is that there's always a chance a Debian update will overwrite
>>>> a pip package, possibly with an older version.  Or a pip-installed
>>>> package might bring in a new version that's not compatible with some
>>>> debian-installed package, breaking something.
>>>
>>>On (recent?) debian/ubuntu pip seems to use the 'user-scheme'
>>>which means pip runs without sudo and installs in ~/.local/lib
>>>So I dont believe literal overwriting would occur
>>
>> Though the point should be made that one should run pip as oneself, and try
>to
>> avoid doing it as the root user (including avoiding sudo). Many
>UNIX/Linux/etc
>> users believe "installs" should be done as root, and in this case that is
>> easily avoided, with all its potential for damage to the vendor supplied
>> environment.
>
>Hmm, I seem to remember not being able to install packages with pip unless I
>did sudo pip.

And this is exactly what I'm warning about. Many Linux users see some kind of 
failure and just stick sudo on the front of the command. It is almost always 
the wrong things to do, leading to effects in the OS install area instead of 
being safely contained within one's home directory or work area.

Instead of reaching straight for sudo, look at pip's manual or help. You will 
find that:

  pip install --user ...

installs modules local to your home directory, avoiding troublesome installs 
into the OS area.

Cheers,
Cameron Simpson <cs at cskk.id.au> (formerly cs at zip.com.au)



More information about the Python-list mailing list