Ubuntu: Using Python 3.3 on Kubuntu 13.04



Question:

I am starting with my first Python project and choose to go with version 3.3 of the language. I'm doing this on a Kubuntu 13.04 x64 box. I appear to have both 2.7 and 3.3 installed (at /usr/bin/python and /usr/bin/python3.3).

Now I want to use some existing python packages (such as python nose) in my project. I tried installing nose using pip, but it looks like it is now installed for 2.7, and not 3.3.

Can I change the main python version of my system to 3.3 (which it breaking horribly - I know stuff in Ubuntu uses python, so am rather concerned this breaking my system). And if not, how can I best get the packages that I need to work on my 3.3 project?


Solution:1

In Ubuntu, you should the apt (Advanced Package Manager) to install related libraries without breaking the system, since pip may not know where exactly it should be look for dependencies, libraries and such. Simply running:

sudo apt-get install python-nose  

should be enough. You can also check the libraries section in the Ubuntu Software Center for more... libraries. If you aren't sure if Ubuntu includes the library, you can search the package list here: http://packages.ubuntu.com/


Solution:2

The simple solution is to use python virtualenv, and running a seperate environment with python 3.3. There seem to be some minor issues setting it up based on the version of ubuntu if you use the package version. You can then run a seperate, purely python environment, using pip to install packages, without totally blowing up your main system.


Note:If u also have question or solution just comment us below or mail us on toontricks1994@gmail.com
Previous
Next Post »