Installing Python with a package manager

This is the second part in a series about installing multiple versions of Python.   The main article which describes why this is necessary for development and testing, or to upgrade back-level os-provided versions is here.

Multiple versions can be installed globally via a package manager like apt-get or yum. Of all the options, this is the preferred method:
  • The package manager can help keep the package current with security and other releases.
  • Package manager installs handle dependency headaches better than compiling it yourself.   Sometimes, far, far better.

Unfortunately, there are disadvantages as well:
  • The user must have either sudo privileges or access to root.
  • There's no ability to install locally to a user's home directory.
  • Not all Python versions are readily available.  For example, Ubuntu 12.04 currently comes with Python2.7 as default and also has version 3.3 available.   If you want 2.4, 2.5, 2.6, 3.1, or 3.2 you're out of luck.  At least in the official repo.
  • An alternate install will add another version of python - without modifying the python executable, by adding a new executable with a version suffix (like python2.7).   This is fine for scripts or programs that can be modified to reference the new version, or for scripts that can be run as an argument to the python executable, but won't work for all applications.    Note also that this is not much of a problem if you're running your Python applications out of virtual environments - since each virtual environment will have a single version of Python.
  • If you're thinking that this will allow you to install some modules (like matplotlib) via the package manager and have them work with your new alternate python - you're out of luck.  They'll be installed in the site-packages directory of the primary python.

If you can use a Package Manager then this is absolutely the best way to go.   And if the only thing holding you back is the lack of availability of the versions you want in the official repositories - then consider some unofficial repositories:
  • For Ubuntu, consider using a PPA such as deadsnakes.
  • For Redhat, consider using their Extra Packages for Enterprise Linux (EPEL)
    • EPEL 5 (for Redhat 5, CentOS 5, etc - which comes with Python2.4 natively) has a package for 2.6, but there's no 2.5, 2.7, 3.3, etc.
    • EPEL 6 (for Redhat 6, CentOS 6, etc - which comes with Python2.6 natively) has no Python packages available.


  1. This comment has been removed by a blog administrator.

  2. This comment has been removed by a blog administrator.

  3. This comment has been removed by a blog administrator.

  4. This comment has been removed by a blog administrator.

  5. Hadoop is one of the best tool which is used to handle the big data in the IT industy and it is the fastest growing field in information technology.
    hadoop training in Chennai | hadoop training chennai

  6. Excellent post!!!. The strategy you have posted on this technology helped me to get into the next level and had lot of information in it.
    salesforce training in chennai | salesforce training institute in chennai

  7. Well Said, you have furnished the right information that will be useful to anyone at all time. Thanks for sharing your Ideas.
    Node JS training in chennai | Node JS training institute in chennai

  8. Excellent content. Thanks for sharing content which is very useful that provided me the required information.
    Cloud Computing Training in Chennai | Cloud Computing Courses in Chennai