Linux under compile and install Python 3.4

Source: Internet
Author: User

Linux under compile and install Python 3.4updated on 2014-09-24 02:01:05 ueaner

System environment:

    • CentOS 6.5 X86_64/fedora x86_64
Install related Packages
# yum install zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make
Download Python 3.4 Source Package
# wget http://mirrors.sohu.com/python/3.4.1/Python-3.4.1.tar.xz
Installing Python 3.4
# xz -d Python-3.4.1.tar.xz# tar xf Python-3.4.1.tar -C /usr/local/src/# cd /usr/local/src/Python-3.4.1/# ./configure --prefix=/usr/local/python34# make -j8 && make install

From the beginning of Python 3.4, the Pip and Easy_install (Setuptools Package command) package Management command, which you can see in the /usr/local/python34/bin/ directory, looks at the installed expansion pack:

# /usr/local/python34/bin/pip3 listpip (1.5.6)setuptools (2.1)
Adding python3.4 related commands to environment variables

Add python3.4 to environment variable, edit ~/.bash_profile , will:

PATH=$PATH:$HOME/bin改为:PATH=$PATH:$HOME/bin:/usr/local/python34/bin

Make the python3.4 environment variable effective:

# . ~/.bash_profile

View the following version:

# python3 --versionPython 3.4.1

Complete!

Linux under compile and install Python 3.4

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.