最新消息:20210816 当前crifan.com域名已被污染,为防止失联,请关注(页面右下角的)公众号

[已解决]CentOS中zsh command not found pip

CentOS crifan 4923浏览 0评论

折腾:

[记录]CentOS中安装和使用virtualenv

期间,想要用pip去安装virtualenv结果出错:

 ~ pip
zsh: command not found: pip

centos command not found: pip

How to Install Pip on CentOS 7 | Liquid Web Knowledge Base

How to install pip on CentOS / RHEL / Ubuntu / Debian

Centos 6 上安装python-pip – 飞翔的荷兰人 – ITeye技术网站

python – How to install pip and easy_install on CentOS – Super User

Linux: Install pip Client To Install Python Packages

CentOS / RHEL / Scientific Linux 6 Enable & Install EPEL Repo

找不到:

 ~ rpm -iUvh http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
Retrieving http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm
curl: (22) The requested URL returned error: 404 Not Found
error: skipping http://dl.fedoraproject.org/pub/epel/7/x86_64/e/epel-release-7-5.noarch.rpm – transfer failed

结果也没找到:

 ~ cd /tmp
 /tmp wget http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm

<div–<2016-08-10 17:17:49–  http://mirror-fpt-telecom.fpt.net/fedora/epel/6/i386/epel-release-6-8.noarch.rpm

Resolving mirror-fpt-telecom.fpt.net… 118.69.250.132
Connecting to mirror-fpt-telecom.fpt.net|118.69.250.132|:80… connected.
HTTP request sent, awaiting response… 404 Not Found
2016-08-10 17:17:49 ERROR 404: Not Found.

不管了,直接去安装pip试试,结果是可以的:

 /tmp yum -y install python-pip
Loaded plugins: security
Setting up Install Process
Resolving Dependencies

<div–<> Running transaction check

<div–<-> Package python-pip.noarch 0:7.1.0-1.el6 will be installed

<div–<> Processing Dependency: python-setuptools for package: python-pip-7.1.0-1.el6.noarch

<div–<> Running transaction check

<div–<-> Package python-setuptools.noarch 0:0.6.10-3.el6 will be installed

<div–<> Finished Dependency Resolution

Dependencies Resolved
======================================================================================================================
 Package                            Arch                    Version                       Repository             Size
======================================================================================================================
Installing:
 python-pip                         noarch                  7.1.0-1.el6                   epel                  1.5 M
Installing for dependencies:
 python-setuptools                  noarch                  0.6.10-3.el6                  base                  336 k
Transaction Summary
======================================================================================================================
Install       2 Package(s)
Total download size: 1.9 M
Installed size: 8.1 M
Downloading Packages:
(1/2): python-pip-7.1.0-1.el6.noarch.rpm                                                       | 1.5 MB     00:01     
(2/2): python-setuptools-0.6.10-3.el6.noarch.rpm                                               | 336 kB     00:00     

<div–<——————————————————————————————————————–

Total                                                                                 1.2 MB/s | 1.9 MB     00:01     
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
  Installing : python-setuptools-0.6.10-3.el6.noarch                                                              1/2 
  Installing : python-pip-7.1.0-1.el6.noarch                                                                      2/2 
  Verifying  : python-pip-7.1.0-1.el6.noarch                                                                      1/2 
  Verifying  : python-setuptools-0.6.10-3.el6.noarch                                                              2/2 
Installed:
  python-pip.noarch 0:7.1.0-1.el6                                                                                     
Dependency Installed:
  python-setuptools.noarch 0:0.6.10-3.el6                                                                             
Complete!

是可以在:

/usr/bin/pip

中找到pip的,版本是:pip 7.1.0

 /tmp lsls /usr/bin/py*
/usr/bin/pydoc  /usr/bin/python  /usr/bin/python2  /usr/bin/python2.6
 /tmp lsls /usr/bin/pip*
/usr/bin/pip  /usr/bin/pip2  /usr/bin/pip2.6
 /tmp where pip  
/usr/bin/pip
 /tmp pip –version
pip 7.1.0 from /usr/lib/python2.6/site-packages (python 2.6)
 /tmp

去试试:

 /tmp rpm -qa|grep pip
python-pip-7.1.0-1.el6.noarch

根据提示去:

pip install –upgrade pip

 jiandaoweixin pip install –upgrade pip
You are using pip version 7.1.0, however version 8.1.2 is available.
You should consider upgrading via the ‘pip install –upgrade pip’ command.
/usr/lib/python2.6/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Collecting pip
  Downloading pip-8.1.2-py2.py3-none-any.whl (1.2MB)
    100% || 1.2MB 32kB/s 
Installing collected packages: pip
  Found existing installation: pip 7.1.0
    Uninstalling pip-7.1.0:
      Successfully uninstalled pip-7.1.0
Successfully installed pip-8.1.2
 jiandaoweixin pip –version
pip 8.1.2 from /usr/lib/python2.6/site-packages (python 2.6)
 jiandaoweixin which pip
/usr/bin/pip
 jiandaoweixin where pip
/usr/bin/pip
 jiandaoweixin

就可以了。

转载请注明:在路上 » [已解决]CentOS中zsh command not found pip

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
89 queries in 0.212 seconds, using 22.11MB memory