1

I've been working inside a conda environment (python==3.6). I've been trying to make a requirements.txt using

pip freeze > requirements.txt

The file shows the following:

pandas @ file:///C:/ci/pandas_1602088210462/work

and

Pillow @ file:///C:/ci/pillow_1609842634117/work

I was expecting to see: pandas==1.1.3

Does anyone has a resolution.

Vadim Kotov
  • 8,084
  • 8
  • 48
  • 62
Bagel8
  • 11
  • 1

1 Answers1

1

You can use conda list --export > requirements.txt to export a conda-compliant list of package you can then import using: conda install --file requirements.txt

Or, as others said, you can also use: pip list --format=freeze > requirements.txt

Daniel Trugman
  • 8,186
  • 20
  • 41
  • 1
    Conda does not export valid PyPI package specifications, which seems to be want OP wants. That is, even though this format is syntactically similar to the `pip freeze` output, it will yield a list of Conda packages not PyPI ones and therefore will not necessarily be compatible with using `pip install -r requirements.txt`. – merv Feb 24 '21 at 22:04