3

Python使用第三方库中的模块 | CHEGVA

 1 year ago
source link: https://chegva.com/5425.html
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Python进阶(18)—使用第三方库中的模块

◎知识点

  1. PyPI简介及下载安装第三方库

  2. pip3使用及导入第三方库中的模块

  3. 将自己开发的库发布到PyPI或共享给他人

◎脚本练习

▽ PyPI简介及下载安装第三方库

"""使用第三方库中的模块"""

"""
除了官方提供的标准库之外,还有非常非常多的第三方库可供我们使用,用以完成各种不同的任务。

如果想要使用第三方库中的模块,必须先使用工具(例如:pip3) 下载安装第三方库,然后通过import语句进行导入。

1、PyPI简介

    PyPI的全程是:Python Package Index,它是Python官方的、基于 Web 的、集中管理的、第三方的软件仓库
    所有人都可以从PyPI下载安装第三方库,或将自己开发的库上传发布到PyPI。
    PyPI的网址:https://pypi.org

2、从PyPI下载安装第三方库

    通常使用工具pip3从PyPI下载安装第三方库。pip的全称是:Package Installer for Python。

    安装最新版本的 Python3 之后,pip3 也被安装上了(在 Windwos 上安装 Python3 时,确保已经勾选了 pip)。
    可以通过命令验证是否已经安装了 pip3: $pip3 或$python3 -m pip

    可以通过命令查看 pip3 的安装路径
    在 Mac0S 或 Ubuntu 操作系统上,输入命令:$ which pip3
    在 Windows 操作系统上, 输入命令: > where pip3
"""
Python
安志合个人博客,版权所有 丨 如未注明,均为原创 丨 转载请注明转自:https://chegva.com/5425.html | ☆★★每天进步一点点,加油!★★☆ | 

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK