---
title: "Ubuntu上安装Python3.2.2"
author: "notfatboy"
date: "2011-10-09T17:01:51Z"
tags: []
categories: ["编程语言"]
slug: "ubuntu-python3-2-2"
draft: false
lastmod: "2011-10-09T17:01:51Z"
id: 1187898
url: "https://notfatboy.iteye.com/blog/1187898"
---

由于程序使用的是python3.0新平台，今天在Ubuntu上尝试安装Python3.2.2（Ubuntu上自带的是2.x版本的python）。最初只是下载源码，编译后发现很多库都用不了。后来才发现原来是要先安装很多库，然后再安装python，总结如下，让后来者少走弯路。

注意下文均在root下完成的，如果其它用户需要用sudo。

 

1, apt-get install build-essential libncursesw5-dev libreadline5-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev libbz2-dev  
2, Download Python-3.2.2.tar.bz2 from the official website.  
3, tar -xjvf Python-3.2.2.tar.bz2  
4, cd Python-3.2.2  
5, ./configure  
6, make  
7, make altinstall #install along with python2.x  
8, cd /usr/bin  
9, rm python  #remove original symbolic link  
10, ln -s python3.2 python # create a new symbolic link