你的心如利箭 在风中笔直的飞翔
github DNS ALEXA CDN
jquery JS CSS CSS3 HTML5 svg php --- isux w3cplus

21270

  博客园  :: 首页  ::  ::  ::  :: 管理

https://pip.pypa.io/en/latest/quickstart/    pip的使用文档

 

http://www.lfd.uci.edu/~gohlke/pythonlibs/      .whl文件 到这个网站下载   (通常情况下是用pip install安装,有些库安装遇到困难后,就要到这个站点,下载.whl 文件再安装)

https://pypi.python.org/pypi   PyPI - Python包索引 。是Python编程语言的软件仓库。

 

https://pypi.douban.com/simple/  豆瓣的库  (安装命令:pip install -i https://pypi.douban.com/simple/  scrapy )

https://www.cnblogs.com/miki-peng/p/12219089.html  python基础(三) - 第三方库的安装方式  2021-8-10

https://docs.python.org/3/py-modindex.html  Python Module Index  2017-10-4

https://wiki.python.org/moin/UsefulModules

https://www.zhihu.com/question/24590883  哪些 Python 库让你相见恨晚?(可以看看)  2017-10-4

https://www.zhihu.com/question/28530832  怎么用最短时间高效而踏实地学习 Python?(有一些好笑的蛇状图)

https://segmentfault.com/a/1190000011568813  《流畅的python》阅读笔记  2017-10-21

https://baike.baidu.com/item/RESTful/4406165  Restful,一种软件架构风格

 


 

 

第三方库的文档:

https://www.w3cschool.cn/tensorflow_python/  TensorFlow官方文档

http://www.tensorfly.cn/tfdoc/get_started/introduction.html  TensorFlow中文社区

https://github.com/jobbole/awesome-python-cn  Python 资源大全中文版

https://zhuanlan.zhihu.com/p/30435576  2017 年最流行的 15 个数据科学 Python 库

 


正文:

当前环境:win7,python3.6.0,pyCharm4.5。  python目录是:c:/python3/

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

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

 

pip常用命令:  某个库(例如是bs4),查看、安装、更新、卸载:  2017-10-18

python -m pip install --upgrade pip             # 升级pip(python3.4之后的版本都自带了PIP,但是需要升级之后才能使用)
python -m pip install --upgrade setuptools      # 升级 setuptools

pip install --force-reinstall --upgrade pip     # 重新安装pip
pip list                        # 查看已安装的库
pip list --format=columns                       # 按列显示

pip show   bs4               # 查看bs4
pip install   bs4            # 安装bs4
pip install -U   bs4         # 更新bs4
pip uninstall    bs4         # 卸载bs4

 

如果系统路径没装对的话,用下面命令:

cd C:\Python3\scripts\
C:\Python3\scripts\>  python pip.exe list             # 查看已安装的库

C:\Python3\scripts\>  python pip.exe show   bs4          # 查看bs4
C:\Python3\scripts\>  python pip.exe install   bs4       # 安装bs4
C:\Python3\scripts\>  python pip.exe install -U   bs4    # 更新bs4
C:\Python3\scripts\>  python pip.exe uninstall   bs4     # 卸载bs4

 

 

PIP安装其它的库 (win7机子)

pip install requests                  # 可以直接安装
pip install requests‑2.18.4‑py2.py3‑none‑any.whl  # http://www.lfd.uci.edu/~gohlke/pythonlibs/ 也可以到这里去找.whl文件,下载后安装

第一种方法,直接安装:

cd C:\Python3\scripts\
pip install arrow ———— 时间 arrow 0.10.0
pip install bs4 ———— BeautifulSoup4(4.6.0)  HTML 解析器
pip install beautifulsoup4
pip install html5lib ———— html5解析器,BeautifulSoup要用到
pip install lxml ———— lxml4.1.0 解析器,BeautifulSoup要用到
pip install cookies ———— cookies2.2.1
pip install Django ———— Django1.11.6 网站
pip install flask ———— flask0.12.2 网站
pip install jieba ———— jieba0.39 中文分词,词频统计
pip install matplotlib ———— matplotlib2.1.0 2D绘图库
pip install numpy ———— numpy1.13.3 开源的数值计算扩展。这种工具可用来存储和处理大型矩阵
pip install pdfkit ———— pdfkit0.6.1 操作pdf
pip install pillow ———— pillow4.3.0 由于PIL仅支持到Python 2.7,加上年久失修,于是一群志愿者在PIL的基础上创建了兼容的版本,名字叫Pillow,支持最新Python 3.x,又加入了许多新特性,因此,我们可以直接安装使用Pillow
pip install pymysql ———— pymysql0.7.10,数据库连接库,连接mysql的
pip install pymongo ———— pymongo3.5.1,数据库连接库,连接mongo的
pip install pytesseract ———— pytesseract0.1.7 ,Tesseract-OCR(识别图像中的文字,还得另外安装其它的。详见博客中的文章)
pip install pyquery ———— pyquery1.3.0
pip install requests ———— requests2.18.4 优雅,简单,人性化的 HTTP 库
pip install urllib3 ———— urllib3 1.22
pip install wheel ———— wheel0.30.0
pip install wordcloud ———— wordcloud 1.3.1 词云图
pip install xlrd ———— xlrd (1.1.0) 读excel
pip install xlwt ———— xlwt (1.3.0) 写excel
pip install setuptools ———— setuptools36.6.0
pip install pymouse ———— 模拟鼠标操作
pip install PyAotuGUI ———— PyAotuGUI0.9.36,模拟鼠标键盘操作
pip install selenium ———— selenium3.3.1 ,selenium + python自动化测试环境搭建
pip install scrapy ———— 这个安装比较麻烦,有很多依赖的库(主要是各种依赖装完了就好,Twisted、vc++等)。最好弄个docker已经装好的镜像来做。
pip install cx_Oracle ———— cx_Oracle6.0.2 oracle数据库

 

第二种方法,使用.whl安装:

windows下那些不能直接安装的库,一般都是因为缺少依赖之类的。解决方法有几种:

  • 用.whl安装
  • 升级python3到最新版本
  • 另行安装依赖

http://www.lfd.uci.edu/~gohlke/pythonlibs/   到这个网站下载.whl文件

不要管它是 win32.whl ,还是  win_amd64.whl,一个不行就试另一个。(如果这样还是装不上,又搞不清楚缺了什么依赖的。咱就别费劲了,docker上找个镜像,在远程试试就得了。)

pip  install  wordcloud‑1.3.2‑cp36‑cp36m‑win32.whl   ————  词云 1.3.2

 

第三种方法,用文本文件的安装:

pip install –r aaa.txt  # 从文本中安装,文本中为包名,一行一个 
pip freeze > aaa.txt  # 导出当前已经安装包 

 

 


还没试用的库:

urllib3  一个具有线程安全连接池,支持文件 post,清晰友好的 HTTP 库。(Python HTTP库,安全连接池、支持文件post、可用性高)

  https://github.com/shazow/urllib3 官网

  http://www.cnblogs.com/KGoing/p/6146999.html  下次看看

pyquery – 一个解析 HTML 的库,类似 jQuery。https://github.com/gawel/pyquery

matplotlib  Matplotlib 能够创建多数类型的图表,如条形图,散点图,条形图,饼图,堆叠图,3D 图和地图图表。  http://matplotlib.sourceforge.net/

      http://www.jianshu.com/p/aa4150cf6c7f  matplotlib教程

Tenacity  Exception Retry 从此无比简单  https://kingname.info/2017/06/18/easy-retry/

TensorFlow  TensorFlow 是一个使用数据流图(data flow graphs)的数值计算库  https://www.tensorflow.org/

 

py2exe  (把代码直接编译成executable,所有人能运行)

simplejson(更快)

 

 


爬虫:

除了基础的 requests 包(http://docs.python-requests.org/en/master/user/quickstart/)以外,python用于抓取页面和网站的最常用和重要的6个库如下:

# Selenium
api文档:http://seleniumhq.github.io/selenium/docs/api/py/
文档: http://selenium-python.readthedocs.io/
抓取网站指导: http://thiagomarzagao.com/2013/11/12/webscraping-with-selenium-part-1/
抓取旅馆价格的代码示例: https://www.scrapehero.com/tutorial-web-scraping-hotel-prices-using-selenium-and-python/

# Beautiful Soup 4
中文文档:https://www.crummy.com/software/BeautifulSoup/bs4/doc.zh/
http://beautifulsoup.readthedocs.io/zh_CN/latest/
简单例子:https://gist.github.com/bradmontgomery/1872970

# pyspider
github文档:https://github.com/binux/pyspider

# scrapy
官网文档:https://scrapy.org/
抓取一个电商网站的例子:https://medium.com/@kaismh/extracting-data-from-websites-using-scrapy-e1e1e357651a#.sw7c9ycio
Scrapinghub:云基的爬虫服务 https://scrapinghub.com/

# lxml
官网文档:http://lxml.de/index.html#introduction
一个更通俗易懂的抓取页面示例的教程:http://docs.python-guide.org/en/latest/scenarios/scrape/

# MechanicalSoup
github文档:https://github.com/MechanicalSoup/MechanicalSoup
详细文档:https://mechanicalsoup.readthedocs.io/en/latest/


 

目前Python主要应用领域:

  • 云计算:       云计算最火的语言, 典型应用OpenStack
  • WEB开发:     众多优秀的WEB框架,众多大型网站均为Python开发,Youtube, Dropbox, 豆瓣。。。, 典型WEB框架有Django
  • 科学运算、人工智能:   典型库NumPy, SciPy, Matplotlib, Enthought librarys,pandas
  • 系统运维:       运维人员必备语言
  • 金融:      量化交易,金融分析,在金融工程领域,Python不但在用,且用的最多,而且重要性逐年提高。原因:作为动态语言的Python,语言结构清晰简单,库丰富,成熟稳定,科学计算和统计分析都很牛逼,生产效率远远高于c,c++,java,尤其擅长策略回测
  • 图形GUI:       PyQT, WxPython,TkInter

补充阅读:https://www.cnblogs.com/CoXieLearnPython/p/9514459.html


 

一些python模块

functools, itertools, operator 是Python标准库为我们提供的支持函数式编程的三大模块

 

 

...

posted on 2017-04-01 13:15  bjhhh  阅读(31009)  评论(0编辑  收藏  举报