安装Python第三方库方法总结

方法一

  • 使用pip命令(在命令行下执行)

  1. 使用如下命令可以查看pip帮助
$ pip --help
Usage:
  pip <command> [options]
Commands:
  install                     Install packages.
  download                    Download packages.
  uninstall                   Uninstall packages.
  freeze                      Output installed packages in requirements format.
  list                        List installed packages.
  show                        Show information about installed packages.
  check                       Verify installed packages have compatible dependencies.
  config                      Manage local and global configuration.
  search                      Search PyPI for packages.
  wheel                       Build wheels from your requirements.
  hash                        Compute hashes of package archives.
  completion                  A helper command used for command completion.
  help                        Show help for commands.
General Options:
  -h, --help                  Show help.
  --isolated                  Run pip in an isolated mode, ignoring environment variables and user configuration.
  -v, --verbose               Give more output. Option is additive, and can be used up to 3 times.
  -V, --version               Show version and exit.
  1. 安装指定的第三方库

    $ pip install

  2. 使用 -U标签更新已安装的指定第三方库

    $ pip install -U

  3. 卸载指定的第三方库

    $ pip uninstall

  4. 下载但并不安装第三方库

    $ pip download

  5. 列出某个第三方库的详细信息

    $ pip show

  6. 搜索第三方库

    $ pip search
    8.列出系统已经安装的库
    $ pip list

方法二

  • 集成安装方法

  • Anaconda http://www.continuum.io
  • 支持近800个第三方库
  • 包含多个主流工具
    -适合数据计算领域开发

方法三

  • 文件安装方法

    为什么有的第三方库可以下载但不能安装?

  • 某些第三方库下载后需要编译再安装
  • 如果操作系统没有编译环境,则能下载不能安装
  • 可以直接下载编译后的版本安装吗?
  • 可以!在UCI页面下载编译完成后的文件安装。
  • 结合你的本地环境,下载合适版本的第三方库,通过如下命令安装
pip install <第三方库所在的路径>

转载于:https://www.cnblogs.com/xucoding/p/9118106.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值