10

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

3 Answers3

4

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
air-dex
  • 5,909
  • 1
  • 23
  • 21
1

You may run different python versions on the same system by setting up the appropriate environment variables. This would allow you to locally install a later version of Python than the synaptic package manager might offer. e.g. in a file (mysetup) have:

TK_LIBRARY=/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/site-packages/PIL:/usr/lib   
TKPATH=/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/site-packages/PIL:/usr/lib 
TCL_LIBRARY=/usr/lib 
export TCL_LIBRARY TK_LIBRARY TKKPATH   

export PYTHONPATH=/usr/lib/python2.7/lib-tk:/usr/lib/python2.7/lib-stdwin:/usr/lib/python2.7/lib-dynload:/usr/lib:.     

and put them into your environment with . mysetup

gerrit
  • 137
ubfan1
  • 19,049
0

Looking at the file list for a pyside package, it appears that it's only been compiled for Python 3.2. You can either:

  • Use 3.2 for now. 3.3 will probably be available with 13.04.
  • Download the source code for pyside (use apt-get source pyside), and recompile it for Python 3.3.
Thomas K
  • 463