linux Pip没有链接到我升级的Python版本,包python3-pip不可用,但被另一个包引用

bprjcwpo  于 2023-08-03  发布在  Linux
关注(0)|答案(4)|浏览(125)

将pip链接到Python 3.7时出现问题。pippip3都已安装,但链接到Python 2.7
我尝试重新安装Python3,然后pip没有进展。
我收到以下消息:
包python3-pip不可用,但被另一个包引用。
这可能意味着软件包丢失、已过时或只能从其他来源获得

$ python --version
Python 3.7.4

$ pip -V
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
pip 19.2.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

$ pip3 -V
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/__init__.py:83: RequestsDependencyWarning: Old version of cryptography ([1, 2, 3]) may cause slowdown.
  warnings.warn(warning, RequestsDependencyWarning)
pip 19.2.1 from /usr/local/lib/python2.7/dist-packages/pip (python 2.7)

$ sudo apt-get install python3-pip
[sudo] password for TarikDev: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Package python3-pip is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'python3-pip' has no installation candidate

字符串

dfddblmv

dfddblmv1#

首先使用此命令

sudo apt-get update

字符串
将下载两个包,大小为16 MB。然后:

sudo apt-get install python2-pip

fhg3lkii

fhg3lkii2#

我试过这个,它对我很有效:

# Download current package information.
sudo apt-get update.

# Install a new package.
sudo apt-get install python3-pip

# Test the package install.
pip -V

字符串

r1zhe5dt

r1zhe5dt3#

转到你的sources.list文件,步骤如下:

cd /etc/apt
sudo nano sources.list

字符串
现在编辑这个文件中的这一行

deb http://http.kali.org/kali kali-rolling main non-free contrib


现在按CTRL+X键,然后按y保存缓冲区,然后按回车键。
现在试试sudo apt-get update
现在键入命令sudo apt-get install python3-pip

cqoc49vn

cqoc49vn4#

首先,使用update命令更新系统

sudo apt-get update

字符串
将pip包安装到机器上

sudo apt-get install python2-pip python3-pip


如果您仍然面临安装pip的挑战,请尝试以下命令:

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

python get-pip.py

pip -V

相关问题