# 使用 Homebrew, apk, apt, dnf, MacPorts, Nix, pacman, scoop, winget 安装 twine

查看 twine 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:twine
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install twine
```

  证据: local Homebrew formula metadata

- MacPorts (94%):

```sh
sudo port install twine
```

  证据: MacPorts ports tree: python/twine/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1

### Linux

- apk (92%):

```sh
sudo apk add twine
```

  证据: Alpine Linux edge package indexes: twine from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz

- Debian apt (92%):

```sh
sudo apt install twine
```

  证据: Debian stable package indexes: twine from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- dnf (92%):

```sh
sudo dnf install twine
```

  证据: Fedora Rawhide package metadata: twine from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst

- Nix (92%):

```sh
nix profile install nixpkgs#twine
```

  证据: nixpkgs package indexes: twine from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix

- pacman (92%):

```sh
sudo pacman -S twine
```

  证据: Arch Linux sync databases: twine from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz

### Windows

- Scoop (92%):

```sh
scoop install extras/twine
```

  证据: Scoop official bucket manifest trees: bucket/twine.json from https://api.github.com/repos/ScoopInstaller/Extras/git/trees/master?recursive=1

- winget (92%):

```sh
winget install --id ChrisKlimas.Twine -e
```

  证据: Windows Package Manager source index: ChrisKlimas.Twine from https://cdn.winget.microsoft.com/cache/source.msix

## 软件包事实

- **软件包键:** brew:twine
- **软件包管理器:** Homebrew
- **版本:** 7.0.0
- **来源摘要:** Utilities for interacting with PyPI
- **主页:** <https://github.com/pypa/twine>
- **仓库:** <https://github.com/pypa/twine>
- **最后更新:** 2026-07-28T23:23:10Z
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- twine (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

- 页面生成时间: 2026-08-03
- 管理器版本: 7.0.0
## 项目历史与用法

Twine is the Python Packaging Authority's command-line utility for uploading Python distribution artifacts to PyPI and compatible repositories. It became the standard small tool between `python -m build` and a public package release.

### 项目历史

Twine was created to separate package building from package uploading and to make PyPI uploads safer and more testable. Its documentation contrasts it with `python setup.py upload`, emphasizing verified HTTPS, uploading already-built artifacts, and support for wheels and source distributions.

The changelog records a long-running 1.x series through the 2010s, a 2.0 release in 2019 that required Python 3.6 or later, 3.x releases that improved non-interactive and keyring behavior, and modern 5.x/6.x work around metadata validation, PyPI token handling, trusted publishing, and removal of older distribution formats.

### 采用历史

Twine's adoption tracks the modernization of Python packaging. As PyPI, Warehouse, wheels, API tokens, and build-system-independent packaging became normal, Twine became the familiar upload command in release checklists, CI jobs, and packaging tutorials.

Its package-manager presence is broad: the input facts show it packaged by Homebrew, Debian, Ubuntu, Fedora/dnf, Arch/pacman, MacPorts, Nix, Scoop, and other ecosystems. That breadth reflects its role as infrastructure for publishing other packages, not as an end-user application.

### 使用方式

The standard workflow is to build distributions, test against TestPyPI if needed, and run `twine upload dist/*`. Twine can read repository and credential information from `.pypirc` or environment variables, prompt interactively, and upload source distributions, wheels, signatures, and newer attestations depending on version.

Package maintainers also use `twine check` to validate distribution metadata and README rendering before upload. In CI, Twine is commonly configured with tokens, trusted publishing, or repository URLs for private Python indexes.

### 为什么软件包爱好者会关心

Twine is package-nerd infrastructure in the purest sense: it exists so other packages can be published predictably. It codified the split between build artifacts and upload transport, which made Python release automation easier to audit and script.

It also captures the Python ecosystem's security migration: away from legacy `setup.py upload` workflows and toward HTTPS, API tokens, keyring integration, metadata validation, and trusted publishing.

### 时间线

- 2010s: Twine 1.x establishes the build-then-upload PyPI workflow.
- 2019-09-24: Twine 2.0.0 requires Python 3.6 or later.
- 2019-2022: Twine 3.x and 4.x improve authentication, non-interactive use, metadata handling, and modern Python support.
- 2024-2025: Twine 5.x and 6.x remove older formats and add work around token defaults, trusted publishing, and refreshed short-lived tokens.

### Related projects

- PyPI and Warehouse are Twine's primary public upload targets.
- `python -m build`, setuptools, wheels, and source distributions form the artifact side of the workflow Twine uploads.
- The Python Packaging User Guide and PyPA recommendations helped make Twine part of standard Python release practice.

### 来源

- Official GitHub repository: https://github.com/pypa/twine
- Official changelog: https://twine.readthedocs.io/en/stable/changelog.html
- Official documentation: https://twine.readthedocs.io/en/stable/
- PyPI project page: https://pypi.org/project/twine/


## 安全说明

没有找到 twine 的匹配本地密钥处理 manifest。Nucleus 软件包元数据仍在此发布，以便未来覆盖拥有稳定的软件包 URL。



## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: ~/.pypirc

## Credential files

- Unix: ~/.pypirc
## 其他软件包管理器记录

- Debian apt - twine - 6.1.0-1: normalized package name match | Debian stable package indexes: twine from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | utility for interacting with PyPI | https://github.com/pypa/twine
- Nix - twine: normalized package name match | nixpkgs package indexes: twine from https://raw.githubusercontent.com/NixOS/nixpkgs/master/pkgs/top-level/all-packages.nix
- Ubuntu apt - twine - 5.0.0-1: normalized package name match | Ubuntu 24.04 LTS package indexes: twine from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | utility for interacting with PyPI | https://github.com/pypa/twine
- apk - twine - 6.1.0-r1: normalized package name match | Alpine Linux edge package indexes: twine from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Collection of utilities for publishing packages on PyPI | https://twine.readthedocs.io/en/latest/
- apk - twine-pyc - 6.1.0-r1: normalized package name match | Alpine Linux edge package indexes: twine-pyc from https://dl-cdn.alpinelinux.org/alpine/edge/community/x86_64/APKINDEX.tar.gz | Precompiled Python bytecode for twine | https://twine.readthedocs.io/en/latest/
- dnf - twine - 6.2.0-7.fc45: normalized package name match | Fedora Rawhide package metadata: twine from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/07190dc5ae9f35ae73866675fed6d95fe6e8d9fe22c9d7cdf85862cb2ed24a4c-primary.xml.zst | Twine is a utility for publishing Python packages on PyPI | https://github.com/pypa/twine
- pacman - twine - 6.2.0-3: normalized package name match | Arch Linux sync databases: twine from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | Collection of utilities for interacting with PyPI | https://github.com/pypa/twine/
- MacPorts - twine: normalized package name match | MacPorts ports tree: python/twine/Portfile from https://api.github.com/repos/macports/macports-ports/git/trees/master?recursive=1
- Scoop - extras/twine: normalized package name match | Scoop official bucket manifest trees: bucket/twine.json from https://api.github.com/repos/ScoopInstaller/Extras/git/trees/master?recursive=1
- winget - ChrisKlimas.Twine: normalized package name match | Windows Package Manager source index: ChrisKlimas.Twine from https://cdn.winget.microsoft.com/cache/source.msix


## Combined YAML source

View the package source record on GitHub. [combined/twine.yml](https://github.com/mxcl/pkgdb/blob/main/combined/twine.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- curated configuration and credential file locations
- curated package history
- pkgdb category and tag curation
- external package-manager database matches
- cross-ecosystem install command graph
