Home  >  Article  >  Operation and Maintenance  >  Detailed introduction to installing Python2.7 development environment under RedHat in Linux

Detailed introduction to installing Python2.7 development environment under RedHat in Linux

黄舟
黄舟Original
2017-05-28 11:46:462087browse

This article mainly introduces in detail LinuxInstallation under RedHatPython2.7, pip, ipython environment, eclipse and The PyDev environment has certain reference value. Interested friends can refer to

Installing Python2.7, pip, ipython environment, eclipse and PyDev environment under Linux RedHat

Preparation , source Python2.6 backup:

Depending on which python specific directory, backup

mv /usr/local/bin/python cd /usr/ local/bin/python2.6

ormv /usr/bin/python /usr/bin/python2.6

Modify to use python2.6 Program configuration, such as yum

vim /usr/bin/yum
#!/usr/bin/python2.6

Check whether yum is normal yum list

##1. Install Python2.7

Official website download Source package: Python-2.7.13.tgz

Compilation:

./configure --prefix=/usr/local

Installation:

make && mak install

Create a soft connection:

cd /usr/local/bin

ln -sv python2.7 python

cp header file: \cp -a /usr/local/

include/python2.7/* /usr/local/include

Enter to view:

2. Install pip

Install

python setup.py install

3. Install ipython

Install

python setup.py install

Install py

sqlite Used for ipython to record history: pip install pysqlite

4. Install eclipse

eclipse depends on jdk, download jdk-8u121-linux-x64.tar.gz

tar -xf jdk-8u121-linux-x64.tar.gz -C /usr/local/

Configure java environment

Variables: vim /etc/profileFinally add:

JAVA_HOME="/usr/local/jdk1.8.0_121" 
PATH=${JAVA_HOME}/bin:$PATH 
CLASSPATH=.:${JAVA_HOME}/lib/dt.jar:${JAVA_HOME}/lib/tools.jar 
export JAVA_HOME 
export PATH 
export CLASSPATH

tar -xf eclipse-java-neon-3-linux- gtk-x86_64.tar.gz

eclipse install pydev plug-in:

help-install new software
add-name:Pydev -location:http://pydev.org/update

Select only PyDev

for eclipse develop, Then continue to the next step until the installation is complete and restart.

Configure python: Here is a screenshot of windows, just select the corresponding path on Linux.

Create PyDev

module, try it, write HelloWorld

At this point, the installation is complete , if an error is reported during the installation, it will prompt that some development libraries are missing, just install it with yum.

The above is the detailed content of Detailed introduction to installing Python2.7 development environment under RedHat in Linux. For more information, please follow other related articles on the PHP Chinese website!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn