When is sudo needed?
Needless use of administrator “sudo” privileges during install of a library or program is generally undesirable. Admin / superuser privileges are typically invoked for a single command by sudo, including on Windows. Casual use of “sudo” can goof up the operating system itself, create cybersecurity risks, and mess up the desired program installation. The install might do undesirable things like put itself under “/root” directory or make paths non-readable by the non-privileged user.
In general we write procedures without invoking sudo, to avoid careless sudo invocation. We assume the user knows when it’s appropriate to invoke sudo. sudo is commonly used with commands installing from repositories like “apt install”.
Python “pip install”
defaults
to
PEP 370
--user
if needed.
In general, don’t install with sudo pip
or sudo conda
to avoid wrecking the system configuration.