---
title: 安装Python-2.7
description: "1. 执行以下命令下载Python语言源码包。"
url: https://www.hikunpeng.com/document/detail/zh/kunpenghpcs/hpcindapp/prtg-osc/kylin_kunpeng_athenameta_13_02_0006.html
sourcePath: /source/zh/kunpenghpcs/hpcindapp/prtg-osc/kylin_kunpeng_athenameta_13_02_0006.html
indexId: 7fb7f39a433c25274f8531791a3dc6f2e4e2d528ce71c1c0b714142a63f12d4382
---
# 安装Python-2.7

#### 操作步骤

1. 执行以下命令下载Python语言源码包。

```
cd
/path/to
/athena_meta/dependences
wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
```


2. 执行以下命令解压安装包。

```
tar -xvf Python-2.7.18.tar.xz
cd python-2.7.18
```


3. 执行以下命令编译安装。

```
./configure --prefix=
/path/to
/athena_meta/dependences
/python-2.7.18
make -j && make -install
```


4. 执行以下命令添加环境变量。

```
vi
~
/.bashrc
```


  在打开的文件追加以下内容。

```
export PATH=
/path/to/athena_meta/dependences
/
python-2.7.18/bin:$PATH
```


  按“Esc”键，输入:wq!，按“Enter”保存并退出编辑。

5. 执行以下命令使修改生效。

```
source
~
/.bashrc
```


6. 执行以下命令查看Python版本。

```
python -V
```
