Why Import Environments?
You may have existing projects using:- Conda
environment.ymlfiles - Pip
requirements.txtfiles - Poetry or other dependency managers
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 condaenvironment.yml files into your workspace.
Basic Import
Import Options
Customize the import with options:- Custom Feature Name
- Custom Environment Name
- Specific Platforms
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:[dependencies] section.
Importing PyPI Requirements
Import piprequirements.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: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:Real-World Examples
Migrate a Data Science Project
Migrate a Web Application
Import from Poetry
While Pixi doesn’t directly importpyproject.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:- Check the lock file:
pixi lock - Update specific packages:
pixi update package-name - Adjust version constraints in
pixi.toml
Best Practices
Next Steps
- Learn about multi-environment workspaces
- Explore Python development with Pixi
- Understand pyproject.toml integration
Future Improvements
Pixi’s import capabilities are actively being developed:- Import roadmap issue on GitHub - Track planned enhancements
- Poetry and PDM integration improvements in progress