docs/reference/cli/pixi/add.md
Adds dependencies to the workspace
--8<-- "docs/reference/cli/pixi/add_extender:description"
pixi add [OPTIONS] <SPEC>...
<SPEC></a>
: The dependency as names, conda MatchSpecs or PyPi requirementsMay be provided more than once.
required: true
--pypi</a>
: The specified dependencies are pypi dependencies. Conflicts with host and build--platform (-p) <PLATFORM></a>
: The platform for which the dependency should be modified. Must be the name of a platform already defined in the workspaceMay be provided more than once.
--feature (-f) <FEATURE></a>
: The feature for which the dependency should be modifieddefault: default
--environment (-e) <ENVIRONMENT></a>
: The environment for which the dependency should be modified. The dependency is written to the content defined inline on the environment, creating the environment if it does not exist--editable</a>
: Whether the pypi requirement should be editable--index <INDEX></a>
: The PyPI index URL to use for this dependency. Only applicable when adding pypi dependencies--auth-file <AUTH_FILE></a>
: Path to the file containing the authentication token--concurrent-downloads <CONCURRENT_DOWNLOADS></a>
: Max concurrent network requests, default is 50--concurrent-solves <CONCURRENT_SOLVES></a>
: Max concurrent solves, default is the number of CPUs--pinning-strategy <PINNING_STRATEGY></a>
: Set pinning strategyoptions: semver, minor, major, latest-up, exact-version, no-pin
--pypi-keyring-provider <PYPI_KEYRING_PROVIDER></a>
: Specifies whether to use the keyring to look up credentials for PyPIoptions: disabled, subprocess
--run-post-link-scripts</a>
: Run post-link scripts (insecure)--no-symbolic-links</a>
: Disallow symbolic links during package installationenv: PIXI_NO_SYMBOLIC_LINKS
--no-hard-links</a>
: Disallow hard links during package installationenv: PIXI_NO_HARD_LINKS
--no-ref-links</a>
: Disallow ref links (copy-on-write) during package installationenv: PIXI_NO_REF_LINKS
--tls-no-verify</a>
: Do not verify the TLS certificate of the server--offline=<OFFLINE></a>
: Run without network access, using only cached data. Commands fail if data is missing from the cache. Pass --offline=false to override an offline setting from the configurationenv: PIXI_OFFLINE
options: y, yes, t, true, on, 1, n, no, f, false, off, 0
--tls-root-certs <TLS_ROOT_CERTS></a>
: Which TLS root certificates to use: 'webpki' (bundled Mozilla roots) or 'system' (system store)env: PIXI_TLS_ROOT_CERTS
--use-environment-activation-cache</a>
: Use environment activation cache (experimental)--no-config</a>
: Don't read system or user-level configuration files. Project-local <project>/.pixi/config.toml is still loadedenv: PIXI_NO_CONFIG
default: false
--config-file <PATH></a>
: Load configuration from this file instead of searching system and user-level paths. Project-local <project>/.pixi/config.toml is still merged on topenv: PIXI_CONFIG_FILE
--git (-g) <GIT></a>
: The git url to use when adding a git dependency--branch <BRANCH></a>
: The git branch--tag <TAG></a>
: The git tag--rev <REV></a>
: The git revision--subdirectory <SUBDIRECTORY></a>
: The subdirectory of the git repository to use--no-install</a>
: Don't modify the environment, only modify the lock fileenv: PIXI_NO_INSTALL
--frozen</a>
: Install the environment as defined in the lock file, doesn't update lock file if it isn't up-to-date with the manifest fileenv: PIXI_FROZEN
--locked</a>
: Check if lock file is up-to-date before installing the environment, aborts when lock file isn't up-to-date with the manifest fileenv: PIXI_LOCKED
--manifest-path (-m) <MANIFEST_PATH></a>
: The path to pixi.toml, pyproject.toml, or the workspace directory--workspace (-w) <WORKSPACE></a>
: Name of the workspace--script (-s) <SCRIPT></a>
: The path to a Python script containing PEP 723 metadataAdds dependencies to the workspace
The dependencies should be defined as MatchSpec for conda package, a PyPI
requirement for the --pypi dependencies, or an absolute path to a local
.conda or .tar.bz2 package file. If no specific version is provided,
the latest version compatible with your workspace will be chosen
automatically or a * will be used.
Example usage:
pixi add python=3.9: This will select the latest minor version that
complies with 3.9.*, i.e., python version 3.9.0, 3.9.1, 3.9.2, etc.pixi add python: In absence of a specified version, the latest version
will be chosen. For instance, this could resolve to python version
3.11.3.* at the time of writing.Adding multiple dependencies at once is also supported:
pixi add python pytest: This will add both python and pytest to the
workspace's dependencies.The --platform and --build/--host flags make the dependency target
specific.
pixi add python --platform linux-64 --platform osx-arm64: Will add the
latest version of python for linux-64 and osx-arm64 platforms.pixi add python --build: Will add the latest version of python for as a
build dependency.Mixing --platform and --build/--host flags is supported
The --pypi option will add the package as a pypi dependency. This cannot
be mixed with the conda dependencies
pixi add --pypi boto3pixi add --pypi "boto3==version"If the workspace manifest is a pyproject.toml, adding a pypi dependency will
add it to the native pyproject project.dependencies array or to the native
dependency-groups table if a feature is specified:
pixi add --pypi boto3 will add boto3 to the project.dependencies
arraypixi add --pypi boto3 --feature aws will add boto3 to the
dependency-groups.aws arraypixi add --pypi --editable 'boto3 @ file://absolute/path/to/boto3' will add
the local editable boto3 to the pypi-dependencies arrayNote that if --platform or --editable are specified, the pypi dependency
will be added to the tool.pixi.pypi-dependencies table instead as native
arrays have no support for platform-specific or editable dependencies.
These dependencies will then be read by pixi as if they had been added to
the pixi pypi-dependencies tables of the default or of a named feature.
The versions will be automatically added with a pinning strategy based on semver or the pinning strategy set in the config. There is a list of packages that are not following the semver versioning scheme but will use the minor version by default: Python, Rust, Julia, GCC, GXX, GFortran, NodeJS, Deno, R, R-Base, Perl
--8<-- "docs/reference/cli/pixi/add_extender:example"