When I run python on RHEL, I automatically use Anaconda3:
Python 3.7.3 (default, Mar 27 2019, 22:11:17)
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>>
When I sudo python, it defaults to python 2.7.
Python 2.7.5 (default, Sep 12 2018, 05:31:16)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-36)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
"which python" vs "sudo which python" gives:
/opt/anaconda3/bin/python
/bin/python
How can I make sudo commands run Anaconda distribution of python. Is there any risk of changing this?
Can I make the change permanently, or do I just run python from sudo using the full Anaconda path?