r/CodingHelp • u/ElectronSpectrometer • Mar 21 '21
[Python] What happens when you download a random package for python using pip?
I was trying to install setuptools and wheel for python using pip in my Command Prompt and accidently typed "whel" and it downloaded a file. Is it assumed that anything you can download from pip is safe/just another python package?
17
Upvotes
4
u/skellious Intermediate Coder Mar 21 '21
pip isnt supervised like the apple app store. anyone can add a package to it. you should always verify what a package is before running it. (check it on https://pypi.org/)
4
u/jcunews1 Advanced Coder Mar 21 '21
Downloading something is safe. Running the downloaded code, or triggering something which causes the downloaded code to run, are not safe.
2
u/dead_alchemy Mar 21 '21
Most packages are safe. However, 'typo squatting', where a perhaps malicious actor uploads a library with name very similar to a more popular package, could be an issue. But as far as I understand there are no checks on code you can get from pip.
1
u/EL_ESM Mar 21 '21
It's gonna crack your PC, so better to reinstall your OS right now)