Answer the question
In order to leave comments, you need to log in
How to make python3 be called by python command in linux?
Python 3 is installed on the system and it is called by the "python3" command. How can I make it be called by the "python" command?
I know it's very easy to do, but it flew out of my head. Googled but didn't find anything.
Answer the question
In order to leave comments, you need to log in
I know it's very easy to do, but it flew out of my head.
eselect python list | grep python3 | awk '{print $1}'| cut -d [ -f 2 | cut -d ] -f 1 | xargs eselect python set
1. Option for the current session for the current user:
2. Option (1) plus adding .bashrc to the configuration (so as not to enter every time after login). You need to relogin at the end:
alias python='python3'
cd ~
echo alias python=\'python3\' >> .bashrc
logout
sudo ln -s /usr/bin/python3 /usr/bin/python
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question