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?


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/

  • Well, this helps me to get things working on my box, though I prefer to not require global installs. In particular, I want people to be able to checkout my code, build it, and be able to run the tests. In nodejs I can install packages locally with npm and in PHP I can do the same with Composer. Is there an equivalent tool/approach for Python? – Jeroen De Dauw Aug 11 '13 at 3:40
  • @Jeroen Debian has packages maintainers that takes pains to provide high quality packages (ergo Ubuntu as fork), that works out-of-the-box. Using the python package manager (and all the others, like CPAN) are not recommended to use under a Debian-like environment. Ubuntu already includes the advanced package tool that provides all the functionality you want. In your README file you should indicate what libraries your program needs like several other programs do. Remember that RPM-based, Debian-based, etc. includes their own package manager and is advisable use them whenever is possible. – Braiam Aug 11 '13 at 3:53
  • it doesn't matter what pains they take, often these are old out of date due to conservatism or time constraints. pip so far has been about the best python package manager I have found. I have less trouble using pip and more often than not get the working libraries I need. I only use apt-get for python as a matter of last resort. – Bill Rosmus Sep 7 '13 at 18:37

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.