Re: How do you install a .whl file globally in debian without breaking system packages?
On Fri, 10 Jul 2026 15:44:55 -0400 (EDT)
Robert Heller <heller@deepsoft.com> wrote:
> Normally you can't do that. If the python package does not have a
> corresponding .deb file in the Debian repository, you can only install
> things in a Python "virtual environment".
>
> There is a "trick":
>
> 1) create a Python "virtual environment", say in /tmp or in your $HOME
>
> 2) use pip in that virtual environment to install the packages there.
>
> 3) create a python3.11 directory tree under /usr/local/lib (or /opt/lib
> if you prefer):
>
> marchhare% dir /usr/local/lib/python3.11/
> dist-packages/ site-packages/
>
> and copy the revevant files from the virtual environment's
> lib/python3.11/
>
> 4) in any Python code that needs to use these packages, add these lines:
>
> import sys
> sys.path.append("/usr/local/lib/python3.11/dist-packages/")
>
> This "trick" is not documented anywhere and the Python community is
> going to bitch that this is bad idea or some such nonsense, but *I*
> don't care. Use at your own risk. All I can say is that it works for
> me and I don't see any real problem with this. Python really should
> include some flavor of the above sys.path.append() call as part of the
> core Python startup code. Almost all other languages do include some
> variant of it, It is a long standing thing in the UNIX world to use
> /usr/local (or /opt) for locally (or non-system supported) installed
> packages.
<snip>
I tried that, but ffmpeg (which was the point of installing vapoursynth),
can't find it. I also just decided to try passing
--break-system-packages. But again, ffmpeg couldn't find vapoursynth. I
guess I'll try using the debian multimedia repo.
Thanks!
Reply to: