linux 安装python pip
时间: 2024-01-13 20:05:43 浏览: 71
python-pip安装
要在Linux上安装Python和pip,可以按照以下步骤进行操作:
1. 下载Python的源码包,并解压缩。可以使用以下命令:
```
tar -xvf Python-3.7.3.tgz
```
2. 进入解压缩后的Python目录:
```
cd Python-3.7.3
```
3. 配置Python的安装路径:
```
./configure --prefix="/usr/local/Python-3.7.3"
```
4. 运行make命令进行编译:
```
make
```
5. 运行make install命令进行安装:
```
make install
```
6. 创建符号链接将Python添加到系统的可执行路径中:
```
ln -s /usr/local/Python-3.7.3/bin/python3 /usr/bin/python3
```
7. 安装pip,可以使用以下命令:
```
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py
```
请注意,这些步骤假设你已经下载了Python的源码包,并且已经安装了所需的依赖库(如zlib和zlib-devel)。确保你具有足够的权限来进行安装操作。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [python linux离线安装.rar](https://download.csdn.net/download/li_wei_ying0809/33430096)[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: 33.333333333333336%"]
- *2* [linux上安装python3和pip3](https://blog.csdn.net/shanmu0737/article/details/123509826)[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: 33.333333333333336%"]
- *3* [Linux中安装Python、PIP](https://blog.csdn.net/yinlu521wang/article/details/98960428)[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: 33.333333333333336%"]
[ .reference_list ]
阅读全文