#1993·pixi

feat(import): conda-based environment with pip (requirements.txt) dependencies

Author: pierrepoCreated Sep 6, 2024Updated Oct 1, 2026
Labelsenhancementgood first issuepypiarea:import

Problem description

This feature request is related to issue #1410

Currently, it is possible to create a new Pixi environment based on a Conda YAML file:

bash
pixi init --import environment.yml

This command works nicely if the environment contains both conda and pip dependencies, for instance:

yaml
name: test
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python=3.12
  - pip
  - pandas
  - matplotlib
  - pip:
    - watermark

However, it does not work if pip dependencies are in an external file, for example:

environment.yml

yaml
name: test
channels:
  - conda-forge
  - nodefaults
dependencies:
  - python=3.12
  - pip
  - pandas
  - matplotlib
  - pip:
    - -r requirements.txt

requirements.txt

watermark
bash
$ pixi init --import environment.yml 
  × Can't parse '-r requirements.txt' as pypi dependency
  ╰─▶ Expected package name starting with an alphanumeric character, found `-`
      -r requirements.txt
      ^

Feature request: could we please import conda YAML file with pip dependencies listed in an external file?