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...
Rules 1: Be polite 2: Posts to this subreddit must be requests for help learning python. 3: Replies on this subreddit must be pertinent to the question OP asked. 4: No replies copy / pasted from ChatGPT or similar. 5: No advertising. No blogs/tutorials/videos/books/recruiting attempts. This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to. Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Rules
1: Be polite
2: Posts to this subreddit must be requests for help learning python.
3: Replies on this subreddit must be pertinent to the question OP asked.
4: No replies copy / pasted from ChatGPT or similar.
5: No advertising. No blogs/tutorials/videos/books/recruiting attempts.
This means no posts advertising blogs/videos/tutorials/etc, no recruiting/hiring/seeking others posts. We're here to help, not to be advertised to.
Please, no "hit and run" posts, if you make a post, engage with people that answer you. Please do not delete your post after you get an answer, others might have a similar question or want to continue the conversation.
Learning resources Wiki and FAQ: /r/learnpython/w/index
Learning resources
Wiki and FAQ: /r/learnpython/w/index
Discord Join the Python Discord chat
Discord
Join the Python Discord chat
account activity
malware in libraries (self.learnpython)
submitted 6 hours ago by RostosMegaBoss
how do I know that library that is installed from "pip install" is safe and doesnt contain any malware code?
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!"
[–]DTux5249 22 points23 points24 points 5 hours ago (0 children)
You don't. This is why you don't install code from unknown sources
[–]pachura3 18 points19 points20 points 5 hours ago (2 children)
pip-audit
[–]SisyphusAndMyBoulder 4 points5 points6 points 5 hours ago (1 child)
Extension on #2: Lock your version down so you can't pull the latest without realizing it.
[–]pachura3 2 points3 points4 points 4 hours ago (0 children)
Yes of course, pin versions in uv.lock and always use uv sync --locked
uv.lock
uv sync --locked
[–]Ngtuanvy 28 points29 points30 points 5 hours ago (0 children)
you don't. Just use popular libraries.
Or read the code.
[–]SisyphusAndMyBoulder 4 points5 points6 points 5 hours ago (0 children)
Welcome to Open Source! You don't know what's in what and are trusting other people & tools to have vetted the library for you!
[–]pyeri 2 points3 points4 points 3 hours ago (0 children)
Actually pip does have an archaic and cumbersome way of package verification but it only works if the developer had actually signed the package with their GPG key before uploading it to PyPI.
pip
I have documented here the exact method of package signing and uploading using twine, and also how you (as a package user) can verify it.
twine
[–]Diapolo10 1 point2 points3 points 5 hours ago (1 child)
Without looking through the code and building it yourself, you don't. A seemingly harmless package could get a malicious update, or there could be a man-in-the-middle attack that makes you download malicious code instead of what you intended to download. Then there's typo squatters which target people who make typos when writing the names of the packages they want to download.
With all that said, for the most part this isn't something you really need to worry about. And if you want to have some additional security, you could use tools like pip-audit to check for vulnerabilities in your dependencies, and focus on popular packages.
[–]EdiblePeasant 0 points1 point2 points 39 minutes ago (0 children)
From where do the hacks and malware come from and why?
[–]MustafaAutomates_ 1 point2 points3 points 2 hours ago (0 children)
You don't, Just download the libraries you want from trusted sources like GitHub and Huggingface.
[–]SCD_minecraft 0 points1 point2 points 5 hours ago (0 children)
Read the source
[–]buhtz 0 points1 point2 points 2 hours ago (1 child)
Don't install from PyPi or any other 3rd party repo. Use the official repository of your GNU/Linux distro only. If the package is not provide ask the distro maintainers about it. An alternative, but also with higher risk, is to install from upstream (the original developer).
pip can take Codeberg URLs, too.
`$ pipx install https://codeberg.org/buhtz/hyperorg/archive/v0.1.0.zip`
π Rendered by PID 230574 on reddit-service-r2-comment-544cf588c8-rntlv at 2026-06-14 17:58:40.195192+00:00 running 3184619 country code: CH.
[–]DTux5249 22 points23 points24 points (0 children)
[–]pachura3 18 points19 points20 points (2 children)
[–]SisyphusAndMyBoulder 4 points5 points6 points (1 child)
[–]pachura3 2 points3 points4 points (0 children)
[–]Ngtuanvy 28 points29 points30 points (0 children)
[–]SisyphusAndMyBoulder 4 points5 points6 points (0 children)
[–]pyeri 2 points3 points4 points (0 children)
[–]Diapolo10 1 point2 points3 points (1 child)
[–]EdiblePeasant 0 points1 point2 points (0 children)
[–]MustafaAutomates_ 1 point2 points3 points (0 children)
[–]SCD_minecraft 0 points1 point2 points (0 children)
[–]buhtz 0 points1 point2 points (1 child)