您的位置:首页 > 编程语言 > Python开发

关于python扩展库若干问题FAQ

2017-11-22 11:22 211 查看
一、求python扩展库下载站点?
加州大学欧文分校一个实验室下属网站,有很全的Python 64位下载包,可供下载使用。
地址如下:http://www.lfd.uci.edu/~gohlke/pythonlibs/

 
二、安装whl的方法?
1、将whl安装包下载到本地。
2、使用如下命令进行安装。

Python -m pip install --user pygame-1.9.2b8-cp36-cp36m-win_amd64.whl

Python -m pip install --user rsa-3.4.2-py2.py3-none-any.whl

 
三 怎样安装pip?

1、到Python的官网上去下载pip。
2、下载地址为:https://pypi.python.org/pypi/pip#downloads
3、下载最新的工具:pip-9.0.1.tar.gz (md5, pgp)
4、下载完成之后,解压到一个文件夹,用CMD控制台进入解压目录
5、执行:python setup.py install
6、在环境变量PATH中添加D:\Python36\Scripts

 
四 pip基本用法?
1、列出已安装包

C:\Users\lenovo>pip list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
Pillow (4.0.0)
pip (9.0.1)
pyasn1 (0.2.3)
pygame (1.9.3)
PyOpenGL (3.1.0)
pywin32 (221)
rsa (3.4.2)
setuptools (28.8.0)
 
2、查看待更新包
C:\Users\lenovo>pip list --outdated
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
Pillow (4.0.0) - Latest: 4.1.1 [wheel]
setuptools (28.8.0) - Latest: 35.0.2 [wheel]

 
3、安装redis

C:\Users\lenovo>pip install redis
Collecting redis
  Downloading redis-2.10.5-py2.py3-none-any.whl (60kB)
    100% |████████████████████████████████| 61kB 19kB/s
Installing collected packages: redis
Successfully installed redis-2.10.5

 
4、卸载redis

C:\Users\lenovo>pip uninstall redis
Uninstalling redis-2.10.5:
  d:\python36\lib\site-packages\redis-2.10.5.dist-info\description.rst
  d:\python36\lib\site-packages\redis-2.10.5.dist-info\installer
  d:\python36\lib\site-packages\redis-2.10.5.dist-info\metadata
  d:\python36\lib\site-packages\redis-2.10.5.dist-info\metadata.json
  d:\python36\lib\site-packages\redis-2.10.5.dist-info\record
  d:\python36\lib\site-packages\redis-2.10.5.dist-info\top_level.txt
  d:\python36\lib\site-packages\redis-2.10.5.dist-info\wheel
  d:\python36\lib\site-packages\redis\__init__.py
  d:\python36\lib\site-packages\redis\__pycache__\__init__.cpython-36.pyc
  d:\python36\lib\site-packages\redis\__pycache__\_compat.cpython-36.pyc
  d:\python36\lib\site-packages\redis\__pycache__\client.cpython-36.pyc
  d:\python36\lib\site-packages\redis\__pycache__\connection.cpython-36.pyc
  d:\python36\lib\site-packages\redis\__pycache__\exceptions.cpython-36.pyc
  d:\python36\lib\site-packages\redis\__pycache__\lock.cpython-36.pyc
  d:\python36\lib\site-packages\redis\__pycache__\sentinel.cpython-36.pyc
  d:\python36\lib\site-packages\redis\__pycache__\utils.cpython-36.pyc
  d:\python36\lib\site-packages\redis\_compat.py
  d:\python36\lib\site-packages\redis\client.py
  d:\python36\lib\site-packages\redis\connection.py
  d:\python36\lib\site-packages\redis\exceptions.py
  d:\python36\lib\site-packages\redis\lock.py
  d:\python36\lib\site-packages\redis\sentinel.py
  d:\python36\lib\site-packages\redis\utils.py
Proceed (y/n)? y
  Successfully uninstalled redis-2.10.5

 
5、pip查看已安装包

C:\Users\lenovo>pip show --files rsa
Name: rsa
Version: 3.4.2
Summary: Pure-Python RSA implementation
Home-page: https://stuvel.eu/rsa Author: Sybren A. Stuvel
Author-email: sybren@stuvel.eu
License: ASL 2
Location: c:\users\lenovo\appdata\roaming\python\python36\site-packages

 
6、pip升级包

C:\Users\lenovo>pip install --upgrade Pillow
Collecting Pillow
  Downloading Pillow-4.1.1-cp36-cp36m-win_amd64.whl (1.5MB)
    100% |████████████████████████████████| 1.5MB 81kB/s
Collecting olefile (from Pillow)
  Downloading olefile-0.44.zip (74kB)
    100% |████████████████████████████████| 81kB 34kB/s
Installing collected packages: olefile, Pillow
  Running setup.py install for olefile ... done
  Found existing installation: Pillow 4.0.0
    Uninstalling Pillow-4.0.0:
      Successfully uninstalled Pillow-4.0.0
Successfully installed Pillow-4.1.1 olefile-0.44

 
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: