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


Groups > comp.lang.python > #197183

Re: Strategies for avoiding having to use --break-system-packages with pip

From Mats Wichmann <mats@wichmann.us>
Newsgroups comp.lang.python
Subject Re: Strategies for avoiding having to use --break-system-packages with pip
Date 2025-01-14 09:06 -0700
Message-ID <mailman.74.1736870769.2912.python-list@python.org> (permalink)
References <jjuh5l-g7rv.ln1@q957.zbmc.eu> <8c110143-0ecd-445b-84bb-d46b0254bbfb@wichmann.us>

Show all headers | View raw


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

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


Thread

Strategies for avoiding having to use --break-system-packages with pip Chris Green <cl@isbd.net> - 2025-01-14 11:32 +0000
  Re: Strategies for avoiding having to use --break-system-packages with pip Mats Wichmann <mats@wichmann.us> - 2025-01-14 09:06 -0700
  Re: Strategies for avoiding having to use --break-system-packages with pip c.buhtz@posteo.jp - 2025-01-14 16:09 +0000
  Re: Strategies for avoiding having to use --break-system-packages with pip Thomas Passin <list1@tompassin.net> - 2025-01-14 11:36 -0500
  Re: Strategies for avoiding having to use --break-system-packages with pip Left Right <olegsivokon@gmail.com> - 2025-01-14 20:06 +0100
  Re: Strategies for avoiding having to use --break-system-packages with pip "Peter J. Holzer" <hjp-python@hjp.at> - 2025-01-18 00:22 +0100
    Re: Strategies for avoiding having to use --break-system-packages with pip Chris Green <cl@isbd.net> - 2025-01-18 11:47 +0000

csiph-web