pixi
安装
curl -fsSL https://pixi.sh/install.sh | sh
or wget -qO- https://pixi.sh/install.sh | sh
autoload -Uz compinit && compinit # redundant with Oh My Zsh
eval "$(pixi completion --shell zsh)"
卸载
pixi clean cache
cd path/to/workspace && pixi clean
rm -r ~/.pixi
# remove `~/.pixi/bin` from your `PATH` in your shell configuration file (e.g., `~/.bashrc`, `~/.zshrc`).
配置: https://pixi.sh/latest/reference/pixi_configuration/
概念
https://pixi.sh/latest/reference/pixi_manifest/
- workspace | 工作区可包含多个环境. 支持两种清单格式:
pyproject.toml和pixi.toml - environments | 环境是功能的集合. Pixi 始终为您的工作区创建一个
default环境,其中包含您的依赖项并在其中运行您的任务。您还可以在一个工作区中包含多个环境 。这些环境位于工作区根目录的.pixi/envs目录中。环境由一个或多个功能构建。 - feature
- dependencies
- tasks
- activation
- target
- package
- system-requirements
- pypi-options
[!NOTE] Conda has a base environment, which is the default environment when you start a new shell. Pixi does not have a base environment. And requires you to install the tools you need in the workspace or globally. Using
pixi global install batwill installbatin a global environment, which is not the same as thebaseenvironment in conda.
[!NOTE] Environment vs Workspace
Condaandmambafocus on managing environments, whilepixiemphasizes workspaces. Inpixi, a workspace is a folder containing a manifest (pixi.toml/pyproject.toml) file that describes the workspace, apixi.locklock-file that describes the exact dependencies, and a.pixifolder that contains the environment.This workspace-centric approach allows for easy sharing and collaboration, as the workspace folder contains all the necessary information to recreate the environment. It manages more than one environment for more than one platform in a single workspace, and allows for easy switching between them. (See multiple environments)
[!NOTE] Global environments
condainstalls all environments in one global location. When this is important to you for filesystem reasons, you can use the detached-environments feature of pixi.pixi config set detached-environments true
# or a specific location
pixi config set detached-environments /path/to/envsThis doesn't allow you to activate the environments using
pixi shell -nbut it will make the installation of the environments go to the same folder.
pixidoes have thepixi globalcommand to install tools on your machine. (See global) This is not a replacement forcondabut works the same aspipxandcondax. It creates a single isolated environment for the given requirement and installs the binaries into the global path.
用法
https://pixi.sh/latest/getting_started/
| 命令 | 描述 |
|---|---|
add | 向工作区添加依赖项 |
auth | 登录 prefix.dev 或 anaconda.org 服务器以访问私人频道 |
build | 工作区配置 |
clean | 清理环境 |
completion | 为 shell 生成完成脚本 |
config | 配置管理 |
exec | 运行命令并将其安装在临时环境中 |
global | 用于全局包管理作的子命令 |
info | 有关当前计算机的系统、工作区和环境的信息 |
init | 创建新工作区 |
import | 将文件导入到现有工作区中的环境中。 |
install | 安装环境,同时更新锁文件和安装环境 |
list | 列出工作区的包 |
lock | 在不安装环境的情况下解决环境并更新锁定文件 |
reinstall | 重新安装环境,更新锁文件和重新安装环境 |
remove | 从工作区中删除依赖项 |
run | 在 pixi 环境中运行任务 |
search | 搜索 conda 包 |
self-update | 将 pixi 更新到最新版本或特定版本 |
shell | 在 pixi 环境中启动 shell,运行 exit 离开 shell |
shell-hook | 打印 pixi 环境激活脚本 |
task | 与工作区中的任务交互 |
tree | 显示工作区依赖项树 |
update | update 命令检查是否有较新版本的依赖项,并相应地更新 pixi.lock 文件和环境 |
upgrade | 检查是否有较新版本的依赖项,并在锁定文件和清单文件中升级它们 |
upload | 上传 conda 包 |
workspace | 通过命令行修改工作空间配置文件 |