pixi import command imports dependencies from external environment files (conda environment.yml or requirements.txt) into your pixi workspace.
Usage
Arguments
Path to the environment file to import. Supported formats:
environment.ymlorenvironment.yaml(conda environment file)requirements.txt(PyPI requirements file)
--format is not specified, pixi will try to detect the format automatically.Options
Format Selection
Explicitly specify the file format to interpret. Options:
conda-env- Conda environment file (environment.yml)pypi-txt- PyPI requirements file (requirements.txt)
Platform Configuration
Specify platforms for the imported environment. Can be specified multiple times.Short flag:
-pEnvironment and Feature Names
Name for the created environment.Short flag:
-eIf not provided, attempts to use the name field from conda environment files. For PyPI files, this is required.Name for the created feature.Short flag:
-fIf not provided, uses the same value as --environment.Import Formats
Conda Environment Files
When importing conda environment files, pixi extracts:
- Dependencies (both conda and pip)
- Channels
- Environment name (if specified)
environment.yml:
pixi.toml:
PyPI Requirements Files
Examplerequirements.txt:
pixi.toml:
Behavior
Automatic Format Detection
If--format is not specified, pixi tries each supported format in order:
- Conda environment format
- PyPI requirements format
Environment Creation
- New environment: Creates a new environment with the specified name and feature
- Existing environment: Adds the feature to the existing environment if not already present
- Feature addition: If the environment exists but doesn’t include the feature, the feature is added to it
Platform Handling
If platforms are specified with--platform, they are added to the feature:
Examples
Import Conda Environment
name field from environment.yml:
Import with Custom Names
Import PyPI Requirements
--environment or --feature specification.
Import with Platforms
Import with Explicit Format
Import to Existing Environment
Global Options
Path to
pixi.toml, pyproject.toml, or workspace directory.Short flag: -mConfig Options
These options override global configuration:--tls-no-verify: Disable TLS verification--auth-file <FILE>: Path to authentication file--pypi-keyring-provider <PROVIDER>: Keyring provider for PyPI
Troubleshooting
Missing Environment Name
Error:Missing name: provide --feature or --environment, or set 'name:' in input file
Solution: Specify the environment/feature name explicitly:
name field.
Unsupported Format
Error:Tried all formats for input file, but none were successful
Solution: Specify the format explicitly:
Unnamed Requirements
Error:Error parsing input file: unnamed requirements are currently unsupported
Solution: Ensure all requirements in requirements.txt have package names:
Constraints Ignored
Warning:Constraints detected in input file, but these are currently unsupported
Constraints (lines starting with -c in requirements.txt) are not yet supported and will be ignored.
Limitations
See Also
- pixi add - Add dependencies to your workspace
- pixi init - Initialize a new pixi workspace
- pixi install - Install workspace dependencies