Search code examples
pythonpython-3.xredhat

How to use command "python3" to execute "/usr/local/bin/python3.6


I've set up python3.6 on new server and defualt python version of it is 2.7. and I want to use command "python3" instead of "/usr/local/bin/python3.6"

python2.7 should be stayed as the default version, I just want to utilize "python3" command. Am I supposed to do use Symbolic link or alias? Is it ok if I'll create virtual envs?

I apologize for my dump question, and I appreciate your help in advance.


Solution

  • Check if /usr/local/bin/ is in your PATH (echo $PATH).
    If not, add it (export PATH=$PATH:/usr/local/bin/) in your ~/.bashrc.
    Restart the shell or source ~/.bashrc