Making the python command run python3 in Linux
Especially helpful on AWS EC2 instances where old versions of python still exist or the python command doesn’t work at all
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
⚙️ Check out my series on Automating Cybersecurity Metrics | Code.
🔒 Related Stories: Bugs | AWS Security | Secure Code
💻 Free Content on Jobs in Cybersecurity | ✉️ Sign up for the Email List
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I have a bunch of pentesting tools and security scanners written over time and some of them depend on “python” being available. Some depend on “python3.” Some of them depending “python” calling “python3.” It’s a mess.
Then there’s AWS where Amazon Linux 2 still uses python 2.7 or something under the hood likely due to precedence issues that create security problems in. Python 3. I’m not sure.
In any case, if you need “python” to run “python3” for your use case, you can use this simple trick.
Edit your ~/.bash_profile file.