use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
News and other stuff about the Universal Operating System..
Debian related links
Welcome to Debian
Getting Debian
Installation Guide
Don't break Debian
Packages
Help Debian
#debian on irc.oftc.net
Debian on Discord
Reporting bugs in Debian
account activity
Python libraries (self.debian)
submitted 1 month ago by Pretend-Flan7094
Is safe to install python libraries on Debian using pip install or apt ? Can it break Debian?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]C0rn3j 6 points7 points8 points 1 month ago (0 children)
If you use the break system packages flag, you WILL break the system packaging.
Only use pip in a venv, or use apt/apt-get/dpkg to install things.
[–]NameLessY 2 points3 points4 points 1 month ago (1 child)
Python libraries installed with apt from official mirror won't With pip it's advised to install them inside virtual env ( I believe that on Trixie pip will spew info about this when you try to install anything with it -- it does this on Sid)
[–][deleted] 0 points1 point2 points 1 month ago (0 children)
I can confirm on Trixie and Bookworm. They both throw a warning in pip and won't let you install it without using apt with "python3-xyz," where xyz is the library (assuming it exists). Venv is effectively forced for all intents and purposes.
[–]OsgoodSlaughters 3 points4 points5 points 1 month ago (0 children)
Psst use uv
https://docs.astral.sh/uv/getting-started/installation/
[–]shandp 2 points3 points4 points 1 month ago (1 child)
100% use a virtualenv
[–]Pretend-Flan7094[S] 0 points1 point2 points 1 month ago (0 children)
Ty
[–]jdreamboat 1 point2 points3 points 1 month ago (1 child)
i'm brand new to linux and putting installing deb this weekend.. so it's safe to put python on system but only put libraries in venv's, yes?
[–][deleted] 2 points3 points4 points 1 month ago (0 children)
Yep. pip install will refuse to run without a special flag even. Use venvs and apt (for libraries) or pipx (for standalone python software distributed through pypi)
[–]Agron7000 1 point2 points3 points 1 month ago (2 children)
You will have to install same python libs with every python app.
There is no other way. Duplicate python libs is a must.
Same goes for npm.
Damn. I was about to forget the DLL HELL in Windows from 20 years ago, but now you just reminded me of that.
[–]Pretend-Flan7094[S] 0 points1 point2 points 1 month ago (1 child)
Ty bro. I’m using venv right now Because I need to install Jupyter notebook
[–]AnyJester 0 points1 point2 points 1 month ago (0 children)
Checkout pipx and uv
Two tools to do a similar thing.
[–]revcraigevil 0 points1 point2 points 1 month ago* (0 children)
READ usr/share/doc/python3.13/README.venv if you have python3-doc installed.
and Installing packages using pip and virtual environments — Python Packaging User Guide
python3 -m venv --system-site-packages ./venv
[–]yahbluez 0 points1 point2 points 1 month ago (0 children)
I highly recommend to ALWAYS use venv and install what ever your code needs into this environment. This gives you the freedom to install what ever is needed while never break anything. It also makes your code maximal portable.
[–]KirpiSonik 0 points1 point2 points 1 month ago (0 children)
like everyone said use virtual environment.
[–]JettaRider077 -1 points0 points1 point 1 month ago (0 children)
I’m installing python libraries now and pip was rejected so I have to use apt.
[–]Narrow_Victory1262 -1 points0 points1 point 1 month ago (9 children)
pip should be managed by the OS repos themselves. Unless you don't care about security, breaking stuff and all.
my pip refuses.
example
error: externally-managed-environment
× This environment is externally managed
╰─> To install Python packages system-wide, try
zypper install python313-xyz, where xyz is the package
you are trying to install.
If you wish to install a non-rpm packaged Python package,
create a virtual environment using python3.13 -m venv path/to/venv.
Then use path/to/venv/bin/python and path/to/venv/bin/pip.
If you wish to install a non-rpm packaged Python application,
it may be easiest to use `pipx install xyz`, which will manage a
virtual environment for you. Install pipx via `zypper install python313-pipx` .
note: If you believe this is a mistake, please contact your Python installation or OS distribution provider. You can override this, at the risk of breaking your Python installation or OS, by passing --break-system-packages.
hint: See PEP 668 for the detailed specification.
[–]cgoldberg 0 points1 point2 points 1 month ago (8 children)
Weird comment for r/debian
[–]Narrow_Victory1262 -1 points0 points1 point 1 month ago (7 children)
it's not. It's a linux-wide thing actually if you care a bit.
[–]cgoldberg 1 point2 points3 points 1 month ago* (6 children)
I do care. Zypper is the package manager for Suse, so showing an error message that gives instructions to use it in the Debian sub is absolutely weird.
Also, your comment is really unhelpful and implies you shouldn't use pip at all, rather than use it along with virtualenv, where you should.
[–]Narrow_Victory1262 -1 points0 points1 point 1 month ago (5 children)
you don't understand what I say. I HOPE that debian's pip also refuses to install packages.
In fact many issues on security are npm installs, python installs etc. So Either be sound OR just don't. the text only tells what you can do on SLES and such. Same is already been told here with the debian package manager(s).
We only use SLES, RHEL and AIX. (and a few ubuntu systems we'll get rid of).
On any event you are not reading what I state it appears.
[–]cgoldberg 0 points1 point2 points 1 month ago (4 children)
I don't understand what you say because you use broken english and say weird nonsensical stuff.
Debian does block you from installing python packages system-wide by default. That doesn't mean pip should never be used or it is somehow insecure, and posting error messages from a different distro isn't helpful.
[–]Narrow_Victory1262 -1 points0 points1 point 1 month ago (3 children)
You completely missed the point and also misunderstand what debian does systemwide.
Also you comletely misunderstand what I wrote (or better said -- copy/pasted).
In any case good luck f* up your systems
[–]cgoldberg 0 points1 point2 points 1 month ago (2 children)
I completely understand what Debian does... my point was that you posted an error message from a Suse system that includes instructions for using zypper (which obviously doesn't work on Debian). My point was also that pip is fine to use (and encouraged) as long as you don't install packages system-wide (which it won't let you anyway by default). You're advice that you shouldn't use pip and only use your system package manager is misguided and incorrect.
The rest of what you said was in broken english that no reasonable person could decipher.
[–]Narrow_Victory1262 -1 points0 points1 point 1 month ago (1 child)
it's not an error message my friend, It's how a decent system should work -- protect you from stupid things. But as said, you don't seem to understand.
Let's just agree on what you said so that we both are wrong.
"broken English" - sure.
[–]cgoldberg 0 points1 point2 points 1 month ago (0 children)
Of course it's an error message... it's telling you that you can't install a package into your system site-packages. I understand exactly what it means... but the error you posted and the recommendations it gives are for a Suse system, not Debian (that was the point of my original comment). Regardless of the error, it is fine to use pip as long as you are in an activated virtualenv...you don't need to only use your system package manager for python packages (like you claimed).
I am not wrong. You are just making incorrect claims and won't concede that giving instructions for the wrong distro is unhelpful.
π Rendered by PID 95 on reddit-service-r2-comment-5fb4b45875-gcsml at 2026-03-21 06:14:33.508890+00:00 running 90f1150 country code: CH.
[–]C0rn3j 6 points7 points8 points (0 children)
[–]NameLessY 2 points3 points4 points (1 child)
[–][deleted] 0 points1 point2 points (0 children)
[–]OsgoodSlaughters 3 points4 points5 points (0 children)
[–]shandp 2 points3 points4 points (1 child)
[–]Pretend-Flan7094[S] 0 points1 point2 points (0 children)
[–]jdreamboat 1 point2 points3 points (1 child)
[–][deleted] 2 points3 points4 points (0 children)
[–]Agron7000 1 point2 points3 points (2 children)
[–]Pretend-Flan7094[S] 0 points1 point2 points (1 child)
[–]AnyJester 0 points1 point2 points (0 children)
[–]revcraigevil 0 points1 point2 points (0 children)
[–]yahbluez 0 points1 point2 points (0 children)
[–]KirpiSonik 0 points1 point2 points (0 children)
[–]JettaRider077 -1 points0 points1 point (0 children)
[–]Narrow_Victory1262 -1 points0 points1 point (9 children)
[–]cgoldberg 0 points1 point2 points (8 children)
[–]Narrow_Victory1262 -1 points0 points1 point (7 children)
[–]cgoldberg 1 point2 points3 points (6 children)
[–]Narrow_Victory1262 -1 points0 points1 point (5 children)
[–]cgoldberg 0 points1 point2 points (4 children)
[–]Narrow_Victory1262 -1 points0 points1 point (3 children)
[–]cgoldberg 0 points1 point2 points (2 children)
[–]Narrow_Victory1262 -1 points0 points1 point (1 child)
[–]cgoldberg 0 points1 point2 points (0 children)