what is best-practice for changing the default global python interpreter on my fresh debian-based linux node to python3.x?
When I create a fresh Debian or Ubuntu VM, one of the first things I do is use apt
to install python3-dev
& python3-pip
, and sometimes either echo "alias python=python3" >> ~/.bashrc
so I don't need to do it again, or even sudo su && echo "alias python=python3" >> /etc/profile.d/00-aliases.sh && exit
when I need to make a daemon user like /home/SQLserviceacct/
or /home/Neo4jworker/
.
The result is often havoc for potential programs or humans who make shell calls to python
and then use any other default python-related environment variables. When things like $PYTHONPATH
get assigned out of context, problems arise. I think virtualenv
is probably involved somehow.
update-alternatives
which I'm starting to think might be, and the 2nd one just says to alias it like I'm already doing. I'm just wondering if there's anything more comprehensive I can do?