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


Groups > comp.lang.python > #197418

Re: Pip installs to unexpected place

Path csiph.com!fu-berlin.de!uni-berlin.de!not-for-mail
From Thomas Passin <list1@tompassin.net>
Newsgroups comp.lang.python
Subject Re: Pip installs to unexpected place
Date Fri, 18 Apr 2025 13:08:36 -0400
Lines 41
Message-ID <mailman.22.1745016497.3008.python-list@python.org> (permalink)
References <CAN06=CxPNLHtr_sdgphR2jrN1V+WbB8wZDJdbvfEDb-MYtmPHA@mail.gmail.com> <bbe32f47-13d2-459c-af22-4e0e37834091@tompassin.net> <4ZcdYR5WnWznV1q@mail.python.org> <cc1c6cf5-f8b9-4528-b6b0-110499b88162@wichmann.us> <4Zd3YM00SYznVKQ@mail.python.org> <CAJQBtgmfgC5aQy_7RXwHDbsxaf1UWYY0=FNsgPPR2UzzuKfTTA@mail.gmail.com> <4ZdrJv0v0LznV1q@mail.python.org> <6d1ac10c-80c0-484b-a7e7-e1966cea1b5d@wichmann.us> <mailman.19.1744926071.3008.python-list@python.org> <m6dnueFg8f0U1@mid.individual.net> <20250418153848.w2hmxpegl3uwii3w@hjp.at> <e1cce2f7-e59b-42bb-95ee-602f241f545b@tompassin.net>
Mime-Version 1.0
Content-Type text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding 7bit
X-Trace news.uni-berlin.de id2h4Cc7DflFgSudImp1VgrueytuQ1EZyK7Bm1L+tbbg==
Cancel-Lock sha1:HzfgteoK9nK361ebTI2jsvNz4y0= sha256:D0nmKCsFMMCLTupPiW/koEuIS97WdxRaXz+uCykRvuQ=
Return-Path <list1@tompassin.net>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
Authentication-Results mail.python.org; dkim=pass reason="2048-bit key; unprotected key" header.d=tompassin.net header.i=@tompassin.net header.b=kfCzBH2r; dkim-adsp=pass; dkim-atps=neutral
X-Spam-Status OK 0.010
X-Spam-Evidence '*H*': 0.98; '*S*': 0.00; 'looks': 0.02; 'scripts.': 0.07; 'python.': 0.08; 'example.': 0.09; 'later,': 0.09; 'mechanism': 0.09; "shouldn't": 0.09; 'directories': 0.16; 'directory.': 0.16; 'greg': 0.16; 'holzer': 0.16; 'mats': 0.16; 'received:10.0.0': 0.16; 'received:64.90': 0.16; 'received:64.90.62': 0.16; 'received:64.90.62.162': 0.16; 'received:dreamhost.com': 0.16; 'root.': 0.16; 'script,': 0.16; 'wichmann': 0.16; 'wrote:': 0.16; 'python': 0.16; 'uses': 0.19; 'bug': 0.19; 'to:addr:python-list': 0.20; 'version': 0.23; 'install': 0.23; 'installed': 0.23; 'seems': 0.26; "isn't": 0.27; 'local': 0.27; '>>>': 0.28; 'wrong': 0.28; 'think': 0.29; 'header :User-Agent:1': 0.30; 'packages': 0.31; 'am,': 0.31; 'program': 0.32; "doesn't": 0.32; '(this': 0.32; 'disabled': 0.32; 'python- list': 0.32; 'received:10.0': 0.32; 'received:mailchannels.net': 0.32; 'received:relay.mailchannels.net': 0.32; 'but': 0.32; 'path': 0.33; 'header:In-Reply-To:1': 0.34; 'package': 0.34; 'this.': 0.35; 'really': 0.36; 'change': 0.36; "it's": 0.37; 'way': 0.38; 'use': 0.39; 'received:100': 0.39; 'place.': 0.40; 'try': 0.40; 'should': 0.40; 'here.': 0.61; "there's": 0.61; 'great': 0.62; 'load': 0.62; 'come': 0.62; 'between': 0.63; 'look': 0.65; 'header:Received:6': 0.67; 'received:64': 0.68; 'site': 0.68; 'manager': 0.68; 'launches': 0.69; 'global': 0.73; 'easy': 0.74; 'editing': 0.84; 'completely.': 0.84; 'location.': 0.84; 'stretch.': 0.84; 'forces': 0.91
X-Sender-Id dreamhost|x-authsender|tpassin@tompassin.net
ARC-Seal i=1; s=arc-2022; d=mailchannels.net; t=1744996117; a=rsa-sha256; cv=none; b=CBKkP1JkSyVtxRk6Y+1bDLeysJ8OZI1r0vqT3nTkuVEexjb55NlthcBK5RjnfaBs940Tln cEf4huLEixT/7ieNI/STiKtieKArgd84OSGE0toUNeoQO4DP7LQKbQGSigq+eQvFW0O/Sc +LWNye+i3W0ArEjNd0RJNl2lrrnt5vBFtHmwKe0x1GAgua+4w16E/Gpp0/22i2c0EPuQ2E 2EsVeVgUx4sLJlrI4qpVFrx0c4QstnLeAcGaueZUATo4uIDteWXfTOdlh+eYsLzzJYwHk0 RYbwV3GkMMV8gIxf/zlDojmU65oxX0HkiVgeZVsjGEY+T9hh/N0yfhGkR5z3LQ==
ARC-Message-Signature i=1; a=rsa-sha256; c=relaxed/relaxed; d=mailchannels.net; s=arc-2022; t=1744996117; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=CIV9tAYYga9pqcEYSYFBaGQpS17BP0Wh2yQq+thFh6E=; b=Gfvo2bwsjRw12smR86TMUChhi19xM3R6nkxlZPkHtL2mpsVRVeEAX0gerg/MlDGUOLrylz f+WiR5fLo+U6tqxMrVQFjfYEkdhI6ckTePCdQrgB0eT44DD7WwS+CBmFDvZFsydsFxHCXd jexF35VYNf6HIXKW5HnAEMP1eGq66s+OVbg8rrtxEeK73OAZERgv7grFgrkzK2NFNzPVTG QRzCG/MgZ+ffV+CrT9vNAZU+ZXnYUKVnwj5pw+Q1M1MD1Nqur0VjAMGgow8mx1b/oK3Ikg YJccl6JO8pR1lExx2ypXS6IFTR3WM0WWXYDm7HYlDwp4jqCNeggFbxBoFmEuuQ==
ARC-Authentication-Results i=1; rspamd-7bd9ff6c58-ks55c; auth=pass smtp.auth=dreamhost smtp.mailfrom=list1@tompassin.net
X-Sender-Id dreamhost|x-authsender|tpassin@tompassin.net
X-MC-Relay Good
X-MailChannels-SenderId dreamhost|x-authsender|tpassin@tompassin.net
X-MailChannels-Auth-Id dreamhost
X-Stretch-Fearful 6ca7843013967878_1744996118166_2477706385
X-MC-Loop-Signature 1744996118166:2742958087
X-MC-Ingress-Time 1744996118166
DKIM-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=tompassin.net; s=dreamhost; t=1744996117; bh=CIV9tAYYga9pqcEYSYFBaGQpS17BP0Wh2yQq+thFh6E=; h=Date:Subject:To:From:Content-Type:Content-Transfer-Encoding; b=kfCzBH2rE4qJkI74+M9kHOTmokL8TYTIcGFUy3Uq08DQ7+KdielLCqgX8SgGXFW+q S7kQ3O7Wm33o5G9V2QcWi0P77ZU97RK6CBSG533BTfmh70TiHeGfYLmNmUeHdbHF66 Clq1WXJYtvUBbJ6RNoW/Jo8fjxPXdiv5jpC/FIB+n9VfUofOp7W6nN5dwELcEG5Oc/ OPpUiBZgJfYtLDo0kXuH+TL0JCA+/j4bzj5b48VfeFe4qDHy0568LDgfTBwyRsiqHI oRlSG+D3LkLTVOXuOneOIOOYLAyedtBwZrAZLXwm8nNgPB1gso36UH+UmIjeHd9tdP TMKwD1neMNPTQ==
User-Agent Mozilla Thunderbird
Content-Language en-US
In-Reply-To <20250418153848.w2hmxpegl3uwii3w@hjp.at>
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.39
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <https://mail.python.org/pipermail/python-list/>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
X-Mailman-Original-Message-ID <e1cce2f7-e59b-42bb-95ee-602f241f545b@tompassin.net>
X-Mailman-Original-References <CAN06=CxPNLHtr_sdgphR2jrN1V+WbB8wZDJdbvfEDb-MYtmPHA@mail.gmail.com> <bbe32f47-13d2-459c-af22-4e0e37834091@tompassin.net> <4ZcdYR5WnWznV1q@mail.python.org> <cc1c6cf5-f8b9-4528-b6b0-110499b88162@wichmann.us> <4Zd3YM00SYznVKQ@mail.python.org> <CAJQBtgmfgC5aQy_7RXwHDbsxaf1UWYY0=FNsgPPR2UzzuKfTTA@mail.gmail.com> <4ZdrJv0v0LznV1q@mail.python.org> <6d1ac10c-80c0-484b-a7e7-e1966cea1b5d@wichmann.us> <mailman.19.1744926071.3008.python-list@python.org> <m6dnueFg8f0U1@mid.individual.net> <20250418153848.w2hmxpegl3uwii3w@hjp.at>
Xref csiph.com comp.lang.python:197418

Show key headers only | View raw


On 4/18/2025 11:38 AM, Peter J. Holzer via Python-list wrote:
> On 2025-04-18 13:24:28 +1200, Greg Ewing via Python-list wrote:
>> On 18/04/25 9:41 am, Mats Wichmann wrote:
>>> There's just not a really great answer to this.
>>
>> Seems to me a system-installed application shouldn't be looking in the
>> user's .local packages in the first place. That should only be for things
>> the user has installed "for this user".
> 
> It's not the application that looks into .local, it's Python. If you say
> that a system-installed Python shouldn't look into ~/.local, then you've
> just disabled that mechanism completely. If not then Python would
> somehow have to distinguish between system-installed and user-installed
> scripts. This isn't as easy as checking whether the path starts with
> /usr/bin or whether it belongs to root. Tying into the system's package
> manager doesn't look appealing to me (not to mention that it might be
> unacceptably slow).

Let's try a specific example. Let's say that PyQt6 v6.8.3 is installed 
in the system site directory. The OS uses PyQt6 for some system 
purposes. Now the user comes along and forces an install of PyQt6 v6.9.0 
in the user site directory. 6.9.0 has a bug that would crash one of the 
system's application but not the user's programs. (This is not a 
far-fetched scenario).

When the system launches its application the PYTHONPATH will start with 
system site directories; local user site directories will be on the 
PYTHONPATH but since they come later, the python will use PyQt6 v6.8.3 
because that will come first on the path.  No crash here.

If the user has a program that actually does require the use of v6.9.0, 
he's going to have to make sure that the user's local site directories 
come first on the path. One way to do that is to set the PYTHONPATH to 
point to the user's location.

In what scenario is a system application going to load a wrong version 
of a dependency from a user's site location? The only one I can think of 
is for the user, with the help of sudo, or by editing some 
system-enabled script, were to change the global PYTHONPATH.  That seems 
a stretch.

Back to comp.lang.python | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: Pip installs to unexpected place Mats Wichmann <mats@wichmann.us> - 2025-04-17 15:41 -0600
  Re: Pip installs to unexpected place Greg Ewing <greg.ewing@canterbury.ac.nz> - 2025-04-18 13:24 +1200
    Re: Pip installs to unexpected place (Posting On Python-List Prohibited) Lawrence D'Oliveiro <ldo@nz.invalid> - 2025-04-18 02:20 +0000
    Re: Pip installs to unexpected place "Peter J. Holzer" <hjp-python@hjp.at> - 2025-04-18 17:38 +0200
    Re: Pip installs to unexpected place Oscar Benjamin <oscar.j.benjamin@gmail.com> - 2025-04-18 17:11 +0100
    Re: Pip installs to unexpected place Thomas Passin <list1@tompassin.net> - 2025-04-18 13:08 -0400
    Re: Pip installs to unexpected place "Peter J. Holzer" <hjp-python@hjp.at> - 2025-04-19 10:38 +0200
    Re: Pip installs to unexpected place "Peter J. Holzer" <hjp-python@hjp.at> - 2025-04-19 10:56 +0200
      Re: Pip installs to unexpected place songbird <songbird@anthive.com> - 2025-04-19 07:49 -0400
    Re: Pip installs to unexpected place Thomas Passin <list1@tompassin.net> - 2025-04-19 15:56 -0400
      Re: Pip installs to unexpected place rbowman <bowman@montana.com> - 2025-04-20 04:34 +0000

csiph-web