码迷,mamicode.com
首页 > 编程语言 > 详细

学习笔记:python3,PIP安装第三方库(2017)

时间:2017-04-01 13:19:12      阅读:651      评论:0      收藏:0      [点我收藏+]

标签:show   python3.4   style   logs   bsp   ack   xlwt   color   pip安装   

pip 之于 python 犹如 npm 之于 node.js,亦犹如 package control 之于 Sublime Text

 

由于python3.4之后的版本都自带了PIP,但是需要升级之后才能使用:
C:\Python3\scripts\> python -m pip install --upgrade pip

 

 

# 查看所安装的package
C:\Python3\scripts\> python pip.exe list

# 查看某一个package
C:\Python3\scripts\> python pip.exe show bs4

#对已经安装的工具包进行更新
C:\Python3\scripts\> python pip.exe install -U bs4


# 安装package
C:\Python3\scripts\> python pip.exe install packagename

# 卸载package
C:\Python3\scripts\> python pip.exe uninstall packagename

 

 

 

 


 

C:\Python3\Lib\site-packages  安装完的库,都被保存在这里了

 

然后就可以通过PIP直接安装其他库了,比如安装requests库,正确的姿势:

C:\Python3\scripts\> python pip.exe install requests (引入第三方库 requests )
C:\Python3\scripts\> python pip.exe install pdfkit (引入第三方库 pdfkit )——操作pdf
C:\Python3\scripts\> python pip.exe install scrapy (引入第三方库 scrapy )——出错了,缺VC++
C:\Python3\scripts\> python pip.exe install pdfkit (引入第三方库 django )
C:\Python3\scripts\> python pip.exe install pymysql (引入第三方库 pymysql )——数据库连接库,连接mysql的
C:\Python3\scripts\> python pip.exe install cookies (引入第三方库 cookies2.2.1 )
C:\Python3\scripts\> python pip.exe uninstall Image (删除第三方库 Image1.5.5 )
C:\Python3\scripts\> python pip.exe install pillow (引入第三方库 PIL )由于PIL仅支持到Python 2.7,加上年久失修,于是一群志愿者在PIL的基础上创建了兼容的版本,名字叫Pillow,支持最新Python 3.x,又加入了许多新特性,因此,我们可以直接安装使用Pillow
C:\Python3\scripts\> python pip.exe install xlwt (引入第三方库 xlwt )——写excel
C:\Python3\scripts\> python pip.exe install xlrd (引入第三方库 xlrd )——读excel
C:\Python3\scripts\> python pip.exe install cx_Oracle (引入第三方库 cx_Oracle )——oracle数据库,装不上,有问题。
C:\Python3\scripts\> python pip.exe install bs4 (引入第三方库 bs4 )

学习笔记:python3,PIP安装第三方库(2017)

标签:show   python3.4   style   logs   bsp   ack   xlwt   color   pip安装   

原文地址:http://www.cnblogs.com/qq21270/p/6655583.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!