如何在 centos7 上为 python 3.7.11 安装 pip

问题描述 投票:0回答:1

我的目标是在centos7上离线安装python3.7.11

首先我在centos7上安装了python3.7.11。使用 https://www.python.org/downloads/release/python-3711/

安装命令是

./configure --enable-optimizations
sudo make altinstall

安装没问题。下一步是 pip install 我尝试 yum install 但那是针对 python 2.7.5 或 3.6.8

如何为 python 3.7.x 安装 pip

这是我的 /usr/local/lib/python3.7/site-packages.

-rw-r--r-- 1 root root  119  5월  3 10:21 README.txt
drwxr-xr-x 2 root root  123  5월  3 10:23 __pycache__
-rw-r--r-- 1 root root  126  5월  3 10:19 easy_install.py
drwxr-xr-x 5 root root   95  5월  3 10:19 pip
drwxr-xr-x 2 root root  130  5월  3 10:19 pip-20.1.1.dist-info
drwxr-xr-x 5 root root  113  5월  3 10:19 pkg_resources
drwxr-xr-x 6 root root 4096  5월  3 10:19 setuptools
drwxr-xr-x 2 root root  170  5월  3 10:19 setuptools-47.1.0.dist-info

如你所见,我有点数。但是命令 pip --version 或 pip3 --version,找不到命令

如何为 python 3.7.x 安装 pip???

python pip centos
1个回答
0
投票

sudo yum update
 
sudo yum install epel-release python-devel python-setuptools python-pip

# Download get-pip.py: Download the installation script for pip using curl.

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py


sudo python3 get-pip.py
© www.soinside.com 2019 - 2024. All rights reserved.