靳闯博客 记录是一种习惯,分享是一种态度
  • 波浪
  • 波浪
  • 波浪
  • 波浪
centos7 安装pip
发表于: | 分类: 技术积累 | 标签: pip | 评论:0 | 阅读: 873

最小化安装完centos系统,默认是没有pip命令的


安装pip

yum install python-pip
Loaded plugins: fastestmirror
base                                                                                                                                                                | 3.6 kB  00:00:00     
epel/x86_64/metalink                                                                                                                                                | 5.1 kB  00:00:00     
epel                                                                                                                                                                | 4.7 kB  00:00:00     
extras                                                                                                                                                              | 3.4 kB  00:00:00     
updates                                                                                                                                                             | 3.4 kB  00:00:00     
(1/4): epel/x86_64/updateinfo                                                                                                                                       | 991 kB  00:00:01     
(2/4): extras/7/x86_64/primary_db                                                                                                                                   | 188 kB  00:00:00     
(3/4): updates/7/x86_64/primary_db                                                                                                                                  | 3.4 MB  00:00:00     
(4/4): epel/x86_64/primary_db                                                                                                                                       | 6.7 MB  00:00:03     
Determining fastest mirrors
 * base: mirrors.zju.edu.cn
 * epel: fedora.cs.nctu.edu.tw
 * extras: ftp.sjtu.edu.cn
 * updates: mirrors.zju.edu.cn
Resolving Dependencies
--> Running transaction check
---> Package python2-pip.noarch 0:8.1.2-8.el7 will be installed
--> Finished Dependency Resolution

Dependencies Resolved

===========================================================================================================================================================================================
 Package                                         Arch                                       Version                                         Repository                                Size
===========================================================================================================================================================================================
Installing:
 python2-pip                                     noarch                                     8.1.2-8.el7                                     epel                                     1.7 M

Transaction Summary
===========================================================================================================================================================================================
Install  1 Package

Total download size: 1.7 M
Installed size: 7.2 M
Is this ok [y/d/N]: y
Downloading packages:
python2-pip-8.1.2-8.el7.noarch.rpm                                                                                                                                  | 1.7 MB  00:00:00     
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
  Installing : python2-pip-8.1.2-8.el7.noarch                                                                                                                                          1/1 
  Verifying  : python2-pip-8.1.2-8.el7.noarch                                                                                                                                          1/1 

Installed:
  python2-pip.noarch 0:8.1.2-8.el7                                                                                                                                                         

Complete!

#验证安装
pip -V
pip 8.1.2 from /usr/lib/python2.7/site-packages (python 2.7)

或者使用最新版;下载地址:https://pypi.org/project/pip/

pip.png

安装:

tar xf pip-18.1.tar.gz
cd pip-18.1
python setup.py install

#报错:
Traceback (most recent call last):
  File "setup.py", line 6, in <module>
    from setuptools import find_packages, setup
ImportError: No module named setuptools

#解决:
wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
sh setuptools-0.6c11-py2.7.egg

#再次执行安装:
python setup.py install

验证pip版本

pip --version
pip 18.1 from /usr/lib/python2.7/site-packages/pip-18.1-py2.7.egg/pip (python 2.7)

商业转载请联系作者获得授权,非商业转载请注明出处,谢谢合作。


如果这篇文章帮助到了你,我感到十分荣幸!

或许你不想写点什么·但我依旧在这里

icon_mrgreen.pngicon_neutral.pngicon_twisted.pngicon_arrow.pngicon_eek.pngicon_smile.pngicon_confused.pngicon_cool.pngicon_evil.pngicon_biggrin.pngicon_idea.pngicon_redface.pngicon_razz.pngicon_rolleyes.pngicon_wink.pngicon_cry.pngicon_surprised.pngicon_lol.pngicon_mad.pngicon_sad.pngicon_exclaim.pngicon_question.png2018new_aini_org.png2018new_baobao_thumb.png2018new_erha_org.png2018new_kuxiao_thumb.png2018new_yun_thumb.png2018new_hufen_thumb.png2018new_gui_org.png2018new_xiaoerbuyu_org.png2018new_heixian_thumb.png2018new_wabi_thumb.png2018new_tianping_thumb.png

站点地图 网站地图
豫ICP备17003270号 | Copyright © 2019 💖 靳闯博客
Typecho🍹Sgreen
TOP