一步下载python2.7相关版本源码例如:Python-2.18.4.tgz

地址:https://www.python.org/downloads/release/python-2718/
在这里插入图片描述

第二步安装

1) 解压

tar zxvf Python-2.7.18.tar.tgz

2)进入文件夹

cd Python-2.7.18

3)执行安装步骤
要先检查环境

gcc --version
#若不存在进行安装
apt-get install gcc
gcc (Debian 12.2.0-3) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
g++ --version 
#若不存在进行安装
apt-get install g++
g++ (Debian 12.2.0-3) 12.2.0
Copyright (C) 2022 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

然后执行安装命令:

  ./configure

  make

 make install

4)检查是否安装成功

命令行输入python出现以下显示结果即为成功。

python
Python 2.7.18 (default, Nov  2 2022, 15:29:52)
[GCC 12.2.0] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>

bash: pip3: command not found

问题描述

使用命令pip3 install XXX,
出现错误bash: pip3: command not found
错误原因pip3没有安装

解决方法

安装 pip3

sudo apt install python3-pip

直接使用aptget安装

 apt-get install python2

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注