无法在 ubuntu 中安装 pip?
Unable to install pip in ubuntu?
我多次尝试安装 pip,但都无法安装。这是我的终端在尝试安装 pip 时的样子:
aman@aman-HP-Pavilion-Notebook:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
aman@aman-HP-Pavilion-Notebook:~$ pip
The program 'pip' is currently not installed. You can install it by typing:
sudo apt-get install python-pip
aman@aman-HP-Pavilion-Notebook:~$ sudo pip
sudo: pip: command not found
aman@aman-HP-Pavilion-Notebook:~$
尝试使用以下命令:
sudo apt-get purge --auto-remove python-pip
sudo apt-get update
sudo apt-get -y install python-pip
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
验证:
pip --help
pip -V
问题可能出在 Ubuntu 14.04 Universe 存储库中。
如果这不起作用,请从此处下载 .deb:
https://packages.ubuntu.com/trusty/all/python-pip/download
然后右键单击 .deb 并安装它
问题可能是您在 PC 上的不同位置安装了两个版本的 python 2,并且 python 副本之一的 pip 不知何故被删除了。因此,当您尝试为副本安装 pip 时,系统会说已经在另一个位置安装了 pip,而且 /usr/local/bin 文件夹也缺少用于安装 pip 的 pip 文件。
我刚刚解决了这个问题,所以我会尝试用一种方式来解释它,让初学者也能正确理解它
将已安装的 pip 文件复制到丢失的位置,而不是通过命令安装它,因为命令会检测已安装的 pip。
解决方法很简单:
运行 这些命令在终端(命令提示符)中 Ubuntu
which pip
#获取已经安装的pip文件的位置
cp location provided by which pip location where to copy pip file
希望对您有所帮助。
我多次尝试安装 pip,但都无法安装。这是我的终端在尝试安装 pip 时的样子:
aman@aman-HP-Pavilion-Notebook:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
python-pip is already the newest version.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
aman@aman-HP-Pavilion-Notebook:~$ pip
The program 'pip' is currently not installed. You can install it by typing:
sudo apt-get install python-pip
aman@aman-HP-Pavilion-Notebook:~$ sudo pip
sudo: pip: command not found
aman@aman-HP-Pavilion-Notebook:~$
尝试使用以下命令:
sudo apt-get purge --auto-remove python-pip
sudo apt-get update
sudo apt-get -y install python-pip
curl "https://bootstrap.pypa.io/get-pip.py" -o "get-pip.py"
python get-pip.py
验证:
pip --help
pip -V
问题可能出在 Ubuntu 14.04 Universe 存储库中。
如果这不起作用,请从此处下载 .deb:
https://packages.ubuntu.com/trusty/all/python-pip/download
然后右键单击 .deb 并安装它
问题可能是您在 PC 上的不同位置安装了两个版本的 python 2,并且 python 副本之一的 pip 不知何故被删除了。因此,当您尝试为副本安装 pip 时,系统会说已经在另一个位置安装了 pip,而且 /usr/local/bin 文件夹也缺少用于安装 pip 的 pip 文件。
我刚刚解决了这个问题,所以我会尝试用一种方式来解释它,让初学者也能正确理解它
将已安装的 pip 文件复制到丢失的位置,而不是通过命令安装它,因为命令会检测已安装的 pip。
解决方法很简单:
运行 这些命令在终端(命令提示符)中 Ubuntu
which pip
#获取已经安装的pip文件的位置
cp location provided by which pip location where to copy pip file
希望对您有所帮助。