Skip to content

Python Packaging Tools - setuptools & wheel

Introduce Python Packaging Tools - setuptools & wheel.

PyPA » Python Packaging User Guide » Guides » Tool recommendations

  • Installation Tool Recommendations
    • Use pip to install Python packages from PyPI.
    • Use virtualenv, or venv to isolate application specific dependencies from a shared Python installation.
  • Packaging Tool Recommendations

setuptools#

Package Index > setuptools

Easily download, build, install, upgrade, and uninstall Python packages

Github Page: pypa / setuptools

setuptools (which includes easy_install) is a collection of enhancements to the Python distutils that allow you to more easily build and distribute Python distributions, especially ones that have dependencies on other packages.

macOS 下使用 brew 安装 python3 时,默认已安装 pip3 和 setuptools。

faner@FAN-MB0:~|  pip3 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.
pip (9.0.1)
setuptools (36.5.0)
wheel (0.30.0)

How can I get a list of locally installed Python modules?

可通过 pip3 show setuptools 命令查看已安装的 setuptools 包信息。

faner@FAN-MB0:~|  pip3 show setuptools
Name: setuptools
Version: 36.5.0
Summary: Easily download, build, install, upgrade, and uninstall Python packages
Home-page: https://github.com/pypa/setuptools
Author: Python Packaging Authority
Author-email: [email protected]
License: UNKNOWN
Location: /usr/local/lib/python3.6/site-packages
Requires:

如果想查看的包未安装,会提示 not found:

$ pip3 show ipykernel
WARNING: Package(s) not found: ipykernel

wheel#

Docs » wheel

A built-package format for Python.
A wheel is a ZIP-format archive with a specially formatted filename and the .whl extension.

macOS 下使用 brew 安装 python3 时,默认已安装 pip3 和 wheel3。

faner@FAN-MB0:~|  wheel3 -V
usage: wheel3 [-h]
              {keygen,sign,unsign,verify,unpack,install,install-scripts,convert,version,help}
              ...
wheel3: error: unrecognized arguments: -V

可通过 pip3 show wheel 命令查看 wheel 包信息。

faner@FAN-MB0:~|  pip3 show wheel
Name: wheel
Version: 0.30.0
Summary: A built-package format for Python.
Home-page: https://github.com/pypa/wheel
Author: Alex Grönholm
Author-email: [email protected]
License: MIT
Location: /usr/local/lib/python3.6/site-packages
Requires: 

Comments