How to avoid putting dev packages in requirements.txt

Viewed 2174

I use pip freeze > requirements.txt to make sure that others in my project can install all the relevant libraries via pip install -r requirements.txt.

The problem is that sometimes I have notebook libraries installed, or IDE specific formatters installed. Maybe I don't want to force my fellow team members to install all this stuff too.

Is there a clean way to do this?

2 Answers

Do it the other way around. Manually write into the file, then install from there.

requirements.txt

requests
numpy

dev-requirements.txt

pytest

Better yet, use Poetry. It solves these issues really nicely.

For this issue, I separate my requirements.txt, one of them for development and another for production.

Also I suggest pyenv to handle this issue easly.

Related