linux yum安装 pip
时间: 2023-11-21 21:16:51 浏览: 99
Linux 下安装pip包的方法
要在Linux上使用yum安装pip,需要执行以下步骤:
1. 首先,确保已经安装了zlib-devel、bzip2-devel、libffi-devel、openssl-devel、ncurses-devel、sqlite-devel、readline-devel、tk-devel、gcc和make等依赖库。可以使用以下命令安装这些依赖库:
`yum install -y zlib-devel bzip2-devel libffi-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gcc make`
2. 下载Python源码包,可以使用以下命令下载最新版本的Python源码包:
`wget https://www.python.org/ftp/python/3.9.13/Python-3.9.13.tgz`
3. 解压下载的Python源码包:
`tar -zxvf Python-3.9.13.tgz`
4. 进入解压后的目录:
`cd Python-3.9.13`
5. 配置编译选项,指定安装路径为`/usr/local/python39`:
`./configure --prefix=/usr/local/python39`
6. 编译并安装Python:
`make && make install`
如果安装的Python版本不带pip,可以通过以下命令安装pip:
1. 下载pip安装脚本:
`curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py`
2. 运行安装脚本来安装pip:
`python get-pip.py`
现在,您已经成功在Linux上使用yum安装了pip。您可以使用`pip -V`命令来检查pip的版本。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* *3* [Linux下python安装与pip常用命令](https://blog.csdn.net/penngo/article/details/126555740)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"]
[ .reference_list ]
阅读全文