Skip to content
Open
Changes from 2 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
30 changes: 30 additions & 0 deletions docs/anaconda.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,33 @@ 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) 将`LUG` 镜像源添加到你的配置文件里。
Copy link
Member

Choose a reason for hiding this comment

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

请称呼我们为「USTC 镜像站」,使用「LUG 镜像站」没有足够的标识度。

另外无论是 USTC 还是 LUG,此处均无需使用 inline code block 格式。

Copy link
Member

Choose a reason for hiding this comment

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

应该是「科大镜像站」吧。

Copy link
Author

Choose a reason for hiding this comment

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

OK,我修改为“科大镜像站”?


配置 `config.toml` 如下:

```bash
Copy link
Member

Choose a reason for hiding this comment

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

该代码块的语言真的是 bash 吗?

Copy link
Author

Choose a reason for hiding this comment

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

是bash语法。

[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 实现了显示当前使用的镜像功能的时候再说。

```
Copy link
Member

Choose a reason for hiding this comment

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

请为所有的代码块指定语言,如 ```shell

Copy link
Member

Choose a reason for hiding this comment

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

另外此代码块与前面的段落之间缺少一个空行。

Copy link
Author

Choose a reason for hiding this comment

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

好的!

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

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

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