Ubuntu – Making python 3.3 default python 3 interpreter instead of 3.2

defaultpysidepythonpython3qt

So, to keep it simple. Ubuntu 12.10 has python 3.2 pre installed and it is linked to "python3". I downloaded python 3.3 and it's command is "python3.3". However, I downloaded pySide for python3 from synaptic. Using "from PySide.QtCore import *" fails on python3.3. BUT, when I ran just "python3" (aka 3.2) everything works fine. Synaptic just installed lib for python3.2 which is default for python3 in ubuntu. How can I force synaptic to install modules for python3.3?

Thanks

Best Answer

You can custom your python3 alias. For this, you can modify your .bashrc file by appending "alias python3='python3.3'" at the end of it. This shell script can do it for you :

#!/bin/bash

cd ~

# Create the ~/.bashrc file if it does not exist
if [ ! -f ./.bashrc ]; then
    touch .bashrc
    chmod 755 .bashrc
    echo "#!/bin/bash" >> .bashrc
fi

# Append the customed alias
echo " " >> .bashrc
echo "alias python3='python3.3'" >> .bashrc
echo " " >> .bashrc

# Reload settings in the .bashrc script
source .bashrc
Related Question