# 使用 Homebrew, pacman, apt 安装 autopep8

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

## 安装

```sh
sudo av install brew:autopep8
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install autopep8
```

  证据: local Homebrew formula metadata

### Linux

- pacman (92%):

```sh
sudo pacman -S autopep8
```

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

- Debian apt (92%):

```sh
sudo apt install python3-autopep8
```

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

## 软件包事实

- **软件包键:** brew:autopep8
- **软件包管理器:** Homebrew
- **版本:** 2.3.2
- **来源摘要:** Automatically formats Python code to conform to the PEP 8 style guide
- **主页:** <https://github.com/hhatto/autopep8>
- **已生成:** 2026-08-03T19:37:03+00:00

## 可执行文件

- autopep8 (别名)

## 安装行为

- Bottle: 不可用

## 版本和新鲜度

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

autopep8 is a Python formatter that uses pycodestyle diagnostics to rewrite code toward PEP 8. It predates the Black era of Python formatting and represents the earlier style of configurable, error-code-driven automatic cleanup.

### 项目历史

The official GitHub repository was created in December 2010. The README describes autopep8 as a tool that automatically formats Python code to conform to PEP 8, using pycodestyle to determine which parts need formatting.

The project grew around pycodestyle error codes: the README lists many E and W codes autopep8 can fix, plus conservative defaults and more aggressive modes for changes that may affect semantics.

### 采用历史

autopep8 spread through Python packaging and editor integrations as a command-line formatter. The batch input lists Homebrew plus Debian/Ubuntu and Arch packages, while the official README points users to pip, PyPI, GitHub, and pre-commit hook usage.

Its GitHub metadata shows thousands of stars and hundreds of forks, consistent with long-running use in Python developer workflows even as opinionated formatters became more prominent later.

### 使用方式

Common usage is autopep8 --in-place with one or more --aggressive flags, or --diff for review. The README also documents module use through fix_code(), recursive operation, parallel jobs, line ranges, pre-commit integration, and pyproject.toml support.

Configuration can come from a global pycodestyle file, project files such as setup.cfg, tox.ini, .pep8, and .flake8, or pyproject.toml under [tool.autopep8], which takes precedence over other configuration files.

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

autopep8 is useful to package nerds because it bridges Python packaging, linter configuration, editor formatting, and pre-commit automation without imposing a single style regime. Its behavior is legible in terms of pycodestyle codes, which makes distro and CI behavior easier to explain than opaque formatter output.

### 时间线

- 2010: hhatto/autopep8 GitHub repository created.
- 2010s: autopep8 becomes a common PEP 8 cleanup command distributed through PyPI and OS package managers.
- 2020s: autopep8 continues supporting pyproject.toml, pre-commit, modern Python versions, and pycodestyle-based fixes.

### Related projects

- pycodestyle supplies the style diagnostics autopep8 uses.
- flake8 and pep8-style configuration files influence autopep8 configuration discovery.
- Black, yapf, docformatter, and eradicate are adjacent Python formatting or cleanup tools.

### 来源

- <https://api.github.com/repos/hhatto/autopep8>
- <https://github.com/hhatto/autopep8#readme>
- source_facts.package-manager


## 安全说明

narrow executable package without higher-risk signals.

- **Geiger 风险:** 绿色 / 低
- narrow executable package without higher-risk signals


## 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: ~/.config/pycodestyle, setup.cfg, tox.ini, .pep8, .flake8, pyproject.toml
- Windows: ~\.pycodestyle, setup.cfg, tox.ini, .pep8, .flake8, pyproject.toml
## 其他软件包管理器记录

- Debian apt - python3-autopep8 - 2.3.2-1: normalized package name match | Debian stable package indexes: python3-autopep8 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | tool that automatically formats Python code to conform to PEP 8 | https://github.com/hhatto/autopep8
- Ubuntu apt - python3-autopep8 - 2.0.4-2: normalized package name match | Ubuntu 24.04 LTS package indexes: python3-autopep8 from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | tool that automatically formats Python code to conform to PEP 8 | https://github.com/hhatto/autopep8
- pacman - autopep8 - 1:2.3.2-2: normalized package name match | Arch Linux sync databases: autopep8 from https://geo.mirror.pkgbuild.com/extra/os/x86_64/extra.db.tar.gz | A tool that automatically formats Python code to conform to the PEP 8 style guide | https://github.com/hhatto/autopep8


## Combined YAML source

View the package source record on GitHub. [combined/autopep8.yml](https://github.com/mxcl/pkgdb/blob/main/combined/autopep8.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
