Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions docs/anaconda.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,34 @@ show_channel_urls: true
官方主页

: <https://www.continuum.io/>

## Pixi

Pixi 是一个高效、跨平台的包管理与环境管理工具,构建于 Conda 生态之上,专为科研与数据科学工作流设计。[Github地址](https://github.com/prefix-dev/pixi)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pixi 是一个高效、跨平台的包管理与环境管理工具,构建于 Conda 生态之上,专为科研与数据科学工作流设计。[Github地址](https://github.com/prefix-dev/pixi)
[Pixi](https://github.com/prefix-dev/pixi) 是一个高效、跨平台的包管理与环境管理工具,构建于 Conda 生态之上,专为科研与数据科学工作流设计。



Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

多余的空行。

Suggested change

Pixi 也支持镜像配置,你可以参考 [此文档](https://pixi.sh/latest/reference/pixi_configuration/#mirrors) 将「科大镜像」源添加到你的配置文件里。

配置 `config.toml` 如下:

```shell
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

请再次检查此文件的语法高亮是否正确。

[mirrors]
"https://conda.anaconda.org/conda-forge" = ["https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge"]
"https://conda.anaconda.org/main" = ["https://mirrors.ustc.edu.cn/anaconda/pkgs/main"]
"https://prefix.dev/conda-forge" = ["https://mirrors.ustc.edu.cn/anaconda/cloud/conda-forge"]
```

如果是项目级别的镜像配置,请配置在此目录:`your_project/.pixi/config.toml`;如果是全局配置,请配置在此目录:`$HOME/.pixi/config.toml`。更多自定义级别的配置,请参考[配置文档](https://pixi.sh/latest/reference/pixi_configuration/)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
如果是项目级别的镜像配置,请配置在此目录:`your_project/.pixi/config.toml`;如果是全局配置,请配置在此目录:`$HOME/.pixi/config.toml`。更多自定义级别的配置,请参考[配置文档](https://pixi.sh/latest/reference/pixi_configuration/)
如果是项目级别的镜像配置,请配置在此目录:`your_project/.pixi/config.toml`;如果是全局配置,请配置在此目录:`$HOME/.pixi/config.toml`。更多自定义级别的配置,请参考[配置文档](https://pixi.sh/latest/reference/pixi_configuration/)


如需验证镜像是否生效,可尝试使用`sudo tcpdump -i any port 443 | grep ustc` 来监听第三方包的下载:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

帮助中应提供软件或命令自带的 debug / verbose 输出来判断实际使用的镜像源或请求的 URL,而不是向终端用户提供 tcpdump 等高级指令或过于底层的 debug 方式。

此建议也适用于 Pixi 本身,即如果用户存在「查看实际使用的镜像源」这样的需求,应当由 Pixi 提供该功能。

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

目前暂不支持,已提issue。prefix-dev/pixi#4755

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tcpdump 的部分建议直接删掉,之后 pixi 实现了显示当前使用的镜像功能的时候再说。


```shell
# 在一个终端运行
sudo tcpdump -i any host mirrors.ustc.edu.cn

# 在另一个终端安装包
pixi add numpy
```
如果看到数据包输出`IP mirrors.ustc.edu.cn.https`,说明正在从 「科大镜像站」下载。

注意:`pixi.lock` 文件中记录的可能仍是原始的 conda.anaconda.org 地址,但实际下载时 pixi 会根据镜像配置自动重定向到 「科大镜像」,这是正常现象。
Loading