When you install Debian Linux when , The installation process may provide you with multiple available Python edition , So there will be multiple Python Executable binaries for . You can use ls Command to see what is in your system Python Binary files of are available for use .
ls /usr/bin/python*
/usr/bin/python /usr/bin/python2 /usr/bin/python2.7 /usr/bin/python3 /usr/bin/python3.4 /usr/bin/python3.4m /usr/bin/python3m
Copy
Execute the following command to view the default Python Version information :
python --version
Python 2.7.8
Copy
1、 User based modification Python edition :
Want to modify... For a specific user Python edition , Just in it home Create one in the directory alias( Alias ) that will do . Open the user's ~/.bashrc file , Add new alias information to modify the default alias Python edition .
vim ~/.bashrc
alias python='/usr/bin/python3.4'
Copy
Once the above operations are completed , Log in again or reload .bashrc file , Make the operation effective .
. ~/.bashrc
Copy
Check the current Python edition .
python --version
Python 3.4.2
which python3
/data/anaconda3/bin/python3
cd /usr/bin
ls -l | grep python
sudo rm -rf python
sudo ln -s /usr/bin/python3 /usr/bin/python
sudo ln -s /usr/bin/python2 /usr/bin/python