Compiling and Configuring Python 3.4.1 on CentOS

Step 1: Remember to turn on RPMForge and EPEL Repository.

For more information on repository, see Repository of CentOS 6 and Scientific Linux 6 

Step 2: Download Python-3.4.1 from the Python Download Page

Step 3: Install Prerequisite Software

# yum install openssl-devel bzip2-devel expat-devel gdbm-devel readline-devel sqlite-devel

 Step 4: Configure and Build

# cd /installation_home/Python-3.4.1
# ./configure --prefix=/usr/local/python-3.4.1
# make
# make install

Step 5: Check that scripts query the correct interpreter:


Step 6: Run from the Installation Directory of Python

# python install

Step 7: Install Python Modules (whatever you need. Here is an example)
You can use pip install to install packages using pip3. See Using pip to install python packages

# /usr/local/python-3.4.1/bin/pip3 install networkx

2 thoughts on “Compiling and Configuring Python 3.4.1 on CentOS

  1. Pingback: Basic Setup and Configuration of JupyterHub with Python-3.4.3 | Linux Cluster

  2. Step6: # python install
    giving error
    [root@localhost Python-3.4.8]# python install
    File “”, line 1876
    exec(, globals(), fficonfig)
    SyntaxError: unqualified exec is not allowed in function ‘configure_ctypes’ it contains a nested function with free variables.

    Kindly reply.


Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.