In a post I was reviewing recently, I read that it's advised not to use 'sudo pip' to install certain items. Can someone clarify why this is and what the downsides/upsides are? Thanks!
Your OS has a Python interpreter to run Python software controlled by your package manager, be it apt, yum, or App Store. Any Python package installed to the system Python installation are dependencies of such software, or that software itself.
By installing or updating packages in your system Python, you can break that software. Also, your modifications would be overwritten with the next update of something that required a dependency you've overwritten ("upgraded"), which often occurs when you install something with many dependencies. This can bite you at the most inopportune moment.
If you value your time and sanity, always use virtualenv
or your favorite wrapper over it. Preferably have one virtualenv per project, and separate virtualenvs for stuff like AWS CLI. Never sudo pip install
anything for your development.
sudo <anything>
is a bad idea because it requires root password/privilege.
Especially when it is not needed.
You may have a rogue pip script sitting somewhere in your path, for example, that can break your system.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With