Home > System Tutorial > LINUX > body text

Easily learn the installation and configuration of Python 2.7 in Linux

王林
Release: 2024-02-15 15:36:03
forward
948 people have browsed it

In today's computer field, Python has become one of the most popular programming languages. Among Python versions, Python 2.7 is still one of the most widely used versions, especially in some old projects. For developers who want to learn Python 2.7, the first thing to do is to install and configure the Python 2.7 environment. This article will help you easily learn the installation and configuration of Python 2.7 from scratch, allowing you to quickly master Python programming skills.

1.Python download

Python download

Address: http://www.python.org/getit/

Version: Python-2.7.3.tgz

setuptoosdownload

Address: http://pypi.python.org/pypi/setuptools#downloads

Version: setuptools-0.6c11.tar.gz(md5)

Download using wget:

wget http://pypi.python.org/packages/source/s/setuptools/setuptools-

0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
Copy after login

2. Install Python

Check the python that comes with the system:

Linux中轻松学习Python 2.7的安装与配置

Plan to install 2.7.3, create a new directory – download the installation package:

Linux中轻松学习Python 2.7的安装与配置

Unzip

tar -zvxf Python-2.7.3.tgz
Copy after login

After decompression, install Python:

Linux中轻松学习Python 2.7的安装与配置
./configure --prefix=/usr/local/python2.7.3
make
make install
Copy after login

After successful installation, the directory is:

Linux中轻松学习Python 2.7的安装与配置

Create a soft link:

Linux中轻松学习Python 2.7的安装与配置

3. Install setuptools

Use wget to download:

[root@biao Python-2.7.3]# pwd
 /python/Python-2.7.3
 [root@biao Python-2.7.3]# cd ..
 [root@biao python]# ll
 total 13832
 drwxr-x--- 18 1000 1002     4096 Dec  5 18:05 Python-2.7.3
 -rwxr-xr-x  1 root root 14135620 Dec  5 17:42 Python-2.7.3.tgz
 [root@biao python]# wget http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz#md5=7df2a529a074f613b509fb44feefe74e
 --18:18:59--  http://pypi.python.org/packages/source/s/setuptools/setuptools-0.6c11.tar.gz
 Resolving pypi.python.org... 140.211.10.73
 Connecting to pypi.python.org|140.211.10.73|:80... connected.
 HTTP request sent, awaiting response... 200 OK
 Length: 256862 (251K) [application/octet-stream]
 Saving to: `setuptools-0.6c11.tar.gz'
100%[======================================================================] 256,862 126K/s 
in 2.0s 18:19:25 (126 KB/s) - `setuptools-0.6c11.tar.gz' saved [256862/256862]
Copy after login

Learning the installation and configuration of Python 2.7 may be a bit tricky for beginners, but as long as you follow the steps introduced in this article, I believe you will easily master these skills. In the process of learning Python programming, don't forget to practice more and continuously improve your programming skills. I believe that you will also become an excellent Python developer in the near future.

The above is the detailed content of Easily learn the installation and configuration of Python 2.7 in Linux. For more information, please follow other related articles on the PHP Chinese website!

source:lxlinux.net
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template