Skip to main content
Learn how to migrate existing conda environments, requirements.txt files, and environment.yml files into Pixi workspaces.

Why Import Environments?

You may have existing projects using:
  • Conda environment.yml files
  • Pip requirements.txt files
  • Poetry or other dependency managers
Pixi can import these environments, preserving your dependencies while adding Pixi’s powerful features.

Before You Start

Ensure you have a Pixi workspace. If not, create one:
If you’re starting from scratch, you can combine pixi init and pixi import into one command - see pixi init —import below.

Importing Conda Environments

Import conda environment.yml files into your workspace.

Basic Import

Import Options

Customize the import with options:
Import into a feature with a different name:
Result:

Merge into Existing Environments

Import into an existing environment:

Import into Default Environment

Import dependencies into the default environment:
This adds dependencies to the top-level [dependencies] section.

Importing PyPI Requirements

Import pip requirements.txt files.

Basic Import

Advanced Requirements

Pixi supports various requirement formats:

Multiple Requirements Files

Import multiple files into the same environment:

Combining Init and Import

Combine workspace creation and import in one command:

Import Conda Environment

Create a workspace from an environment.yml:
Result:
pixi init --import adds dependencies to the default environment, unlike pixi import which creates a new environment.

Override Workspace Name

Specify a custom workspace name:
At the time of writing, pixi init --import only supports the conda-env format, not pypi-txt.

Automatic Format Detection

Pixi can detect the format automatically:
Or specify explicitly:

Real-World Examples

Migrate a Data Science Project

Migrate a Web Application

Import from Poetry

While Pixi doesn’t directly import pyproject.toml from Poetry, you can export and import:

Post-Import Tasks

After importing, you may want to:

Add Tasks

Define common commands:

Add More Dependencies

Create Additional Environments

Update Lock File

Troubleshooting

Import Format Not Detected

Specify the format explicitly:

Feature Name Required

For PyPI imports, always specify a feature or environment:

Platform-Specific Dependencies

Some dependencies may not be available on all platforms. Use platform-specific imports:

Version Conflicts

If you encounter conflicts after import:
  1. Check the lock file: pixi lock
  2. Update specific packages: pixi update package-name
  3. Adjust version constraints in pixi.toml

Best Practices

Test after import: Always test your imported environments to ensure everything works.
Use features for organization: Import related dependencies into separate features for better organization.
Specify platforms: If your environment is platform-specific, use --platform to document this.
Keep original files: Keep the original environment.yml or requirements.txt for reference during migration.

Next Steps

Future Improvements

Pixi’s import capabilities are actively being developed: