# 使用 Homebrew, apt, dnf 安装 pytorch

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

## 安装

```sh
sudo av install brew:pytorch
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install pytorch
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install libtorch-dev
```

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

- dnf (92%):

```sh
sudo dnf install python3-torch
```

  证据: Fedora Rawhide package metadata: python3-torch from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst

## 软件包事实

- **软件包键:** brew:pytorch
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/pytorch>
- **版本:** 2.13.0
- **来源摘要:** Tensors and dynamic neural networks
- **主页:** <https://pytorch.org/>
- **仓库:** <https://github.com/pytorch/pytorch>
- **上游文档:** <https://pytorch.org/>
- **许可证:** BSD-3-Clause
- **源码归档:** <https://github.com/pytorch/pytorch/releases/download/v2.13.0/pytorch-v2.13.0.tar.gz>
- **最后更新:** 2026-07-13T07:02:46Z
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- torchrun (cli)
- torchrun (别名)

## 依赖

- abseil
- eigen
- libomp
- libuv
- libyaml
- numpy
- onnx
- openblas
- protobuf
- pybind11
- sleef

## 构建依赖

- cmake
- ninja
- python@3.14

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 2.13.0
- 管理器更新时间: 2026-07-13
- 本地数据: OK
- 上游仓库: https://github.com/pytorch/pytorch
- 信息: No cached GitHub release or tag data was available.

## 安全说明

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


## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** pytorch
- **Version Scheme:** 0
- **Revision:** 0
- **Requirements:** macos, xcode
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** stable

## 其他软件包管理器记录

- Debian apt - libtorch-dev - 2.6.0+dfsg-7: normalized package name match | Debian stable package indexes: libtorch-dev from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Tensors and Dynamic neural networks in Python (Development Files) | https://pytorch.org/
- Debian apt - libtorch-test - 2.6.0+dfsg-7: normalized package name match | Debian stable package indexes: libtorch-test from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Tensors and Dynamic neural networks in Python (Test Binaries) | https://pytorch.org/
- Debian apt - libtorch2.6 - 2.6.0+dfsg-7: normalized package name match | Debian stable package indexes: libtorch2.6 from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Tensors and Dynamic neural networks in Python (Shared Objects) | https://pytorch.org/
- Debian apt - python3-torch - 2.6.0+dfsg-7: normalized package name match | Debian stable package indexes: python3-torch from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | Tensors and Dynamic neural networks in Python (Python Interface) | https://pytorch.org/
- dnf - python3-torch - 2.12.0-6.fc45: normalized package name match | Fedora Rawhide package metadata: python3-torch from https://dl.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/x86_64/os/repodata/210a2053c8e007daf9ae39c2a21daaed9b2ddd07d63ecffa597050361e73650c-primary.xml.zst | PyTorch AI/ML framework | https://pytorch.org/


## 相关链接

- [MCP tool packages](https://pkg.so/zh-hans/mcp-tools/) - Mentions MCP or Model Context Protocol.
- [AI and agent packages](https://pkg.so/zh-hans/ai-agent-tools/) - Matched AI model, agent, coding-agent, orchestration, or MCP metadata.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Language runtime packages](https://pkg.so/zh-hans/language-runtime-packages/) - Matched language runtime, compiler, or interpreter metadata.
- [protobuf](https://pkg.so/zh-hans/brew/protobuf/) - Runtime dependency declared by Homebrew.
- [numpy](https://pkg.so/zh-hans/brew/numpy/) - Runtime dependency declared by Homebrew.
- [python@3.14](https://pkg.so/zh-hans/brew/python-3-14/) - Build dependency declared by Homebrew.
- [cmake](https://pkg.so/zh-hans/brew/cmake/) - Build dependency declared by Homebrew.
- [ninja](https://pkg.so/zh-hans/brew/ninja/) - Build dependency declared by Homebrew.
- [openai-whisper](https://pkg.so/zh-hans/brew/openai-whisper/) - Popular package that depends on this formula.
- [pocket-tts](https://pkg.so/zh-hans/brew/pocket-tts/) - Popular package that depends on this formula.
- [mlx](https://pkg.so/zh-hans/brew/mlx/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools, python.
- [magika](https://pkg.so/zh-hans/brew/magika/) - Shares pkgdb curated category or tags: ai, cli, deep-learning, machine-learning, ml-tools.
- [djl-serving](https://pkg.so/zh-hans/brew/djl-serving/) - Shares pkgdb curated category or tags: ai, cli, deep-learning, machine-learning, ml-tools.
- [rgf](https://pkg.so/zh-hans/brew/rgf/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools, python.
- [tesseract](https://pkg.so/zh-hans/brew/tesseract/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools.
- [openvino](https://pkg.so/zh-hans/brew/openvino/) - Shares pkgdb curated category or tags: ai, cli, deep-learning, ml-tools.
- [opencv](https://pkg.so/zh-hans/brew/opencv/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools.
- [hf](https://pkg.so/zh-hans/brew/hf/) - Shares pkgdb curated category or tags: ai, cli, machine-learning, ml-tools.
- [ncnn](https://pkg.so/zh-hans/brew/ncnn/) - Local package facts share a topical domain. Shared terms: abseil, ai, cli, learning, libomp.

## Combined YAML source

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


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
