Deutsch   English   Français   Italiano  
<mailman.74.1736870769.2912.python-list@python.org>

View for Bookmarking (what is this?)
Look up another Usenet article

Path: ...!eternal-september.org!feeder3.eternal-september.org!fu-berlin.de!uni-berlin.de!not-for-mail
From: Mats Wichmann <mats@wichmann.us>
Newsgroups: comp.lang.python
Subject: Re: Strategies for avoiding having to use --break-system-packages
 with pip
Date: Tue, 14 Jan 2025 09:06:06 -0700
Lines: 57
Message-ID: <mailman.74.1736870769.2912.python-list@python.org>
References: <jjuh5l-g7rv.ln1@q957.zbmc.eu>
 <8c110143-0ecd-445b-84bb-d46b0254bbfb@wichmann.us>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.uni-berlin.de DePoS2oBZ0+kzC5cos/V9gG6vPD3FZbcoebrHWbG8jJA==
Cancel-Lock: sha1:e7PY0AqLcOrsW4k03PYTI0Lc6U4= sha256:2WFpZSmNoF615rC01D7vByzDiM+mxYiGMgN5/rsKbDA=
Return-Path: <mats@wichmann.us>
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=messagingengine.com header.i=@messagingengine.com
 header.b=qFiBAMdx; dkim-adsp=none (unprotected policy);
 dkim-atps=neutral
X-Spam-Status: OK 0.002
X-Spam-Evidence: '*H*': 1.00; '*S*': 0.00; 'pip': 0.04; 'thread':
 0.05; 'acquired': 0.09; 'debian': 0.09; 'environment,': 0.09;
 'git': 0.09; 'moved': 0.09; 'myself.': 0.09; 'subject:packages':
 0.09; 'utility': 0.09; 'well:': 0.09; 'that.': 0.15; 'command.':
 0.16; 'declare': 0.16; 'else?': 0.16; 'executable': 0.16;
 'installed.': 0.16; 'invoke': 0.16; 'pip,': 0.16; 'pypi.': 0.16;
 'received:10.202': 0.16; 'received:10.202.2': 0.16;
 'received:internal': 0.16; 'received:messagingengine.com': 0.16;
 'root.': 0.16; 'subject:pip': 0.16; 'virtualenv': 0.16; 'wrote:':
 0.16; 'python': 0.16; 'probably': 0.17; "can't": 0.17; 'uses':
 0.19; 'to:addr:python-list': 0.20; 'option': 0.20; 'written':
 0.22; "i've": 0.22; 'i.e.': 0.22; 'ran': 0.22; "what's": 0.22;
 'install': 0.23; 'command': 0.23; 'installed': 0.23; 'laptop':
 0.23; 'run': 0.23; 'anything': 0.25; 'cover': 0.26; 'chris': 0.28;
 'mostly': 0.28; 'environment': 0.29; 'whole': 0.30; 'header:User-
 Agent:1': 0.30; 'packages': 0.31; 'program': 0.32; "doesn't":
 0.32; 'python-list': 0.32; 'but': 0.32; 'subject:for': 0.32;
 "i'm": 0.33; 'there': 0.33; 'script': 0.33; 'server': 0.33;
 'header:In-Reply-To:1': 0.34; 'able': 0.34; 'running': 0.35;
 'words': 0.35; 'months': 0.35; 'this.': 0.35; 'cases': 0.36;
 'image': 0.36; 'those': 0.36; 'couple': 0.37; "skip:' 10": 0.37;
 'using': 0.37; "it's": 0.37; 'put': 0.38; 'both': 0.38; 'use':
 0.39; 'two': 0.39; "that's": 0.39; 'quite': 0.39; 'least': 0.39;
 'single': 0.39; 'prompt': 0.39; '(see': 0.40; 'program.': 0.40;
 'something': 0.40; 'want': 0.40; 'likely': 0.61; 'come': 0.62;
 'me.': 0.64; 'your': 0.64; 'url-ip:172.67/16': 0.64; 'ago.': 0.64;
 'look': 0.65; 'years': 0.65; 'further': 0.69; 'small,': 0.69;
 'interest': 0.70; 'desktop': 0.70; 'virtual': 0.71; 'article':
 0.73; '(that': 0.84; 'subject: \n ': 0.84; 'subject:Strategies':
 0.84; 'travels': 0.84; 'received:103': 0.91; 'green': 0.96
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=wichmann.us; h=
 cc:content-transfer-encoding:content-type:content-type:date:date
 :from:from:in-reply-to:in-reply-to:message-id:mime-version
 :references:reply-to:subject:subject:to:to; s=2018-07.pbsmtp; t=
 1736870767; x=1736957167; bh=a2mxV9i2nJvc/N1EZWP9tESIYq7yb7X7LeQ
 VwWF7T6A=; b=jQDqK1GOfj2lGI3UaPwqbLXjRPH8aNT/qGnb3vt9N7CnSXN9TD7
 +mYSAgajPLNyuqEpWbHTgT6v4XXbwIcZNt/Nkc8SfOC+hrpsVtLyUuJ3i/5HMOnQ
 EUmwTJKErFhDGuO29LEdUF3eRrf+s46nS1we0x4q4KrCFUJLLm6tALFg=
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=
 messagingengine.com; h=cc:content-transfer-encoding:content-type
 :content-type:date:date:feedback-id:feedback-id:from:from
 :in-reply-to:in-reply-to:message-id:mime-version:references
 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender
 :x-me-sender:x-sasl-enc; s=fm2; t=1736870767; x=1736957167; bh=a
 2mxV9i2nJvc/N1EZWP9tESIYq7yb7X7LeQVwWF7T6A=; b=qFiBAMdxm2jbfpL6j
 UTDB3s7icW/CdZIuimlyiaVmXmyiJSvtADAUmJ8dR9zWgo2RI2txBVxRep01MP3K
 lZMzTBYPdmbuu18G++vZ6SkpuB2T61G1s/30xOPF4kMqnAey4/NHwBXRvXC5d0zQ
 ttKjuhdKHr+WzeBwC8eRAiNMz0QEhDGpHwaSQ655BAo4VSMylQb/YiHcxucQdS2D
 CyS0c6bnsJ3T5ECDqdsmYVnO5MYCm4OOEBLYXf08Zcrnt7QmfN9biTMaxGIlME34
 GNJS3r+kq2WQiRxtqI0d2Bt/siI0EG/O0sTm0bKy6VPcEm++VcNteRI9+M5FNEeh
 f1svA==
X-ME-Sender: <xms:b4uGZ0ob3DphGYWlRWf2rPHH6toTTuJg9NhqiK4Nwj0OAUgqCjTUwg>
 <xme:b4uGZ6o2amxeFwhoncnsOJOj81FjqgTC07tFqNH0FS7thKulwv3NO3mvgA2lBH2BM
 lHKUBMFBFYhRSs7QBc>
X-ME-Received: <xmr:b4uGZ5Nabl5BkBTiG-1B7LS_rT47tgwYjY482Ws08xpSLTHFLHQRXMThBBxJr_i3sHpm4YWKORxGwpoNMx8AP9Kpg_LKJyC4Ig>
X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrudehiedgkeegucetufdoteggodetrfdotf
 fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu
 rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfg
 fuvfhfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpeforghtshcuhghitghhmhgrnhhn
 uceomhgrthhsseifihgthhhmrghnnhdruhhsqeenucggtffrrghtthgvrhhnpeevtedvgf
 eigeevjeejudehkeetkeekueevkeeuudefkeefteeuudeukeduuedvteenucffohhmrghi
 nheprghsthhrrghlrdhshhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh
 grihhlfhhrohhmpehmrghtshesfihitghhmhgrnhhnrdhushdpnhgspghrtghpthhtohep
 uddpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepphihthhhohhnqdhlihhsthesph
 ihthhhohhnrdhorhhg
X-ME-Proxy: <xmx:b4uGZ74OxJhm3GmpygsPI1XxWqJFUok9zyjBQjBP8JCgfpG_gAc4aw>
 <xmx:b4uGZz6_JMgO_V1m6MAeYBipQTTJtJzF09Ue8Wh2R68weCHFKr7wlA>
 <xmx:b4uGZ7i9hc3RL4UEubDktJ7CbUPRa6KAz1KtehPsNQ-6RX3tITvXgg>
 <xmx:b4uGZ96oopIAzbe3S0ojxEut-4q5gxN-aggZCmNe0ru7OJk2LhYt8A>
 <xmx:b4uGZwgXB0PaYPny9hANg9zSfRO9LZtWX2-oLZJJ4W75nRsWO51HQQ_l>
Feedback-ID: i387144f0:Fastmail
User-Agent: Mozilla Thunderbird
Content-Language: en-US
Autocrypt: addr=mats@wichmann.us; keydata=
 xsDiBD9xp6oRBAC1vd3YI8Gcr1CxpV1gldNQu0uQsNaICDk+Ai3+R163s/P83JOYG+SBEA3P
 v7iZx70qpQ3RzP7KrjF1N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VEAoKDYHfDp5Q3q
 PuPvPahCE9HsXMgAAJ9INTqcLSJrOfyJ8q95nBO1T26H2Q==
In-Reply-To: <jjuh5l-g7rv.ln1@q957.zbmc.eu>
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: <8c110143-0ecd-445b-84bb-d46b0254bbfb@wichmann.us>
X-Mailman-Original-References: <jjuh5l-g7rv.ln1@q957.zbmc.eu>
Bytes: 10304

On 1/14/25 04:32, Chris Green via Python-list wrote:
> I have a (relatively) clean Debian 12 installation running on my two
> workhorse systems, a desktop server at home and my laptop that travels
> around with me.
> 
> I moved from Xubuntu to Debian on both these systems a few months ago.
> 
> I ran Xubuntu for many years and acquired a whole lot of python
> packages installed with pip, as root.  For the last couple of years I
> had to use the --break-system-packages option to get things installed.
> 
> As far as I'm aware I never hit any dependency problems doing this.
> It's probably because things I installed with pip were mostly quite
> small, specialised, packages that I used in just one or two utility
> programs that I had written myself.  In quite a few cases these were
> realated to image processing and such things.
> 
> 
> So far I've managed to keep my Debian 12 installations 'pip free', I
> haven't even got pip installed.  However I may have just come across
> something that would at least be very useful and it comes from PyPi.
> (It's tkintertable if that's of any interest or relevance)
> 
> 
> What are my options?
>     
>      Just install it using pip as root and --break-system-packages,
>      what's likely to break?
> 
>      Use a virtual environment, what do I have to do then to make using
>      my program (that uses tkintertable) 'transparent', i.e. I just
>      want to be able to run the program from the command prompt like
>      any other program.
> 
>      Download tkintertable from git into my development environment and
>      use that.  My PYTHONPATH will need to point to it but I can't see
>      any further issues with doing this.
> 
>      Anything else?  As far as I can see using pipx doesn't help me at
>      all (see recent thread here).


You might look at uv, which makes the managing of a virtualenv for your 
program pretty transparent. You declare your dependencies, and then just:

uv run myscript.py

And of course if you don't want to type three words to launch, you can 
put those in an executable shell script in your path, and invoke it with 
a single command.

There was a nice article on this somewhere which I now can't find, but 
the project docs cover the topics pretty well:

https://docs.astral.sh/uv/guides/scripts