Install Vim in the latest version on RHEL6.5 and add support for Python2.7.5

Source: Internet
Author: User
Tags perl script
Many vim plug-ins on git require a later version of vim, and rhel6.5 installs vim 7.2 by default. To make vim support these plug-ins and make vim work more efficiently, the interface looks more beautiful. You need to compile and install the latest vim version. Recommended reading: Vim Learning Guide: http://www.linuxidc.com/linux/2013-08/89096.htm vieditor: http://www.linuxidc.com/linux

Many vim plug-ins on git require a later version of vim, and rhel6.5 installs vim 7.2 by default. To make vim support these plug-ins and make vim work more efficiently, the interface looks more beautiful. You need to compile and install the latest vim version.

Recommended reading:

  • Vim Learning Guide http://www.linuxidc.com/Linux/2013-08/89096.htm
  • Quick learn Vi editor http://www.linuxidc.com/Linux/2013-08/88586.htm
  • Powerful Vim editor http://www.linuxidc.com/Linux/2013-07/87544.htm
  • Build a Vim Development Environment http://www.linuxidc.com/Linux/2013-07/87363.htm on CentOS 6.2
  • Vim 7.4a release, new and faster http://www.linuxidc.com/Linux/2013-07/87035.htm for regular expression Engines
  • CentOS 5.4 installation highlighted Vim editing tool http://www.linuxidc.com/Linux/2013-06/86508.htm
  • Vim tips: C language http://www.linuxidc.com/Linux/2012-12/77124.htm settings
  • Set Vim row http://www.linuxidc.com/Linux/2012-12/75485.htm in Ubuntu
  • Vim editor use basic tutorial http://www.linuxidc.com/Linux/2013-05/84031.htm

1. Check the default python installation version of rhel6.5.
2. Install python multi-version management tools
3. Install python 2.7.5
4. Install the latest version of vim
5. Install ipython using pip

1. Check the default python installation version of rhel6.5.

By default, python 2.6.6 installed in rhel 6.5 is shown in the following output:

# Python

Python 2.6.6 (r266: 84292, Sep 4 2013, 07:46:00)

2. Install python multi-version management tools

You need to use the related functions of the new version of Python, but do not want to affect the built-in Python. In this case, you need to implement coexistence of multiple versions of Python.

# Curl-L https://raw.githubusercontent.com/yyuu/pyenv-installer/master/bin/pyenv-installer | bash

Add in. bashrc

# Vim. bashrc

Export PYENV_ROOT = "$ {HOME}/. pyenv"

If [-d "$ {PYENV_ROOT}"]; then

Export PATH = "$ {PYENV_ROOT}/bin: $ {PATH }"

Eval "$ (pyenv init -)"

Fi

# Source. bashrc


Pyenv Common commands

Pyenv install -- list to view installed versions

Pyenv install 2.7.5 install the specified version

Pyenv versions

Pyenv version: view the current Python version.

Pyenv global 2.7.5 sets the global python version.

Pyenv local 2.7.5: set local python to only affect the current working directory


We recommend that you do not use global switch because some software in the current system depends on the default version of python, such as yum.

3. Install python 2.7.5

Install dependency:

Yum-y install gcc-c ++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel

To make python 2.5.7 installation faster, import python to domestic sources

# Export PYTHON_BUILD_MIRROR_URL = "http://pyenv.qiniudn.com/pythons"


Install python 2.5.7 using pyenv

[Root @ www ~] # Pyenv install 2.7.5

Downloading Python-2.7.5.tgz...

-> Http://pyenv.qiniudn.com/pythons/b4f01a1d0ba0b46b05c73b2ac909b1df

Installing Python-2.7.5...

Patching file./Modules/readline. c

Hunk #1 succeeded at 204 (offset-2 lines ).

Hunk #2 succeeded at 747 (offset-2 lines ).

Hunk #3 succeeded at 857 (offset-2 lines ).

Hunk #4 succeeded at 905 (offset-13 lines ).

Installed Python-2.7.5 to/root/. pyenv/versions/2.7.5

 

Downloading setuptools-3.6.tar.gz...

-> Https://pypi.python.org/packages/source/s/setuptools/setuptools-3.6.tar.gz

Installing setuptools-3.6...

Installed setuptools-3.6 to/root/. pyenv/versions/2.7.5

 

Downloading pip-1.5.6.tar.gz...

-> Https://pypi.python.org/packages/source/p/pip/pip-1.5.6.tar.gz

Installing pip-1.5.6...

Installed pip-1.5.6 to/root/. pyenv/versions/2.7.5

You can see that not only python is installed, but pip 1.5.6 is also installed.

# Pyenv versions

* System (set by/root/. pyenv/version)

2.7.5

Pip installation method:

# Wget -- no-check-certificate https://bootstrap.pypa.io/get-pip.py

# Python get-pip.py

Switch between multiple python versions:

# Pyenv versions

* System (set by/root/. pyenv/version)

2.7.5

# Pyenv local 2.7.5

# Pyenv versions

System

* 2.7.5 (set by/root/. python-version)

4. Install the latest version of vim

Download source code:

# Yum-y install hg

# Hg clone https://code.google.com/p/vim/ vim

To enable vim to support python, install pythen-devel:

# Yum install-y python-devel

#./Configure -- with-features = huge \

-- Enable-gui = gnome2 -- enable-luainterp = yes -- enable-pythoninterp = dynamic \

-- Enable-rubyinterp = yes -- enable-perlinterp = yes -- enable-cster \

-- Enable-fontset -- enable-multibyte -- enable-sniff -- enable-xim \

-- Prefix =/usr/local/vim74 \

-- With-python-config-dir =/root/. pyenv/versions/2.7.5/lib/python2.7/config

# Make & make install

# Echo 'path =/usr/local/vim74/bin: $ path'>/etc/profile. d/vim. sh

# Source/etc/profile

# Echo $ PATH

# Vim/etc/man. conf

MANPATH/usr/local/vim74/share/man

# Vim. vimrc add

Set nocompatible "No to the total compatibility with the specified ent vi


Solve the following errors during compilation:

/Usr/bin/perl/usr/share/perl5/ExtUtils/xsubpp-prototypes-typemap \

/Usr/share/perl5/ExtUtils/typemap if_perl.xs> auto/if_perl.c

Can't open perl script "/usr/share/perl5/ExtUtils/xsubpp": No such file or directory

Make [1]: *** [auto/if_perl.c] Error 2

Make [1]: Leaving directory '/root/soft/vim/src'

Make: *** [first] Error 2

Solution:

Yum search perl | grep ExtUtils

Yum install-y perl-ExtUtils-Embed

View the newly installed vim:

# Vim

: Version

VIM-Vi IMproved 7.4 (2013 Aug 10, compiled May 22 2014 09:55:19)

5. Install ipython using pip

# Pip install ipython

This article permanently updates the link address: Http://www.linuxidc.com/Linux/2014-05/102104.htm

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.