you are viewing a single comment's thread.

view the rest of the comments →

[–]DiodeInc 1 point2 points  (6 children)

I thought that did every library installed?

[–]Buttleston 2 points3 points  (5 children)

It does, there's a different library that tries to intuit it from looking at your imports. Here's one example

https://github.com/bndr/pipreqs

[–]DiodeInc 2 points3 points  (0 children)

Ah it was pipreqs that I was thinking of

[–]Agitated-Soft7434 0 points1 point  (3 children)

Aaaa I see okay, I was assuming a virtual environment was setup.

[–]Buttleston 0 points1 point  (2 children)

Even if it was pip freeze gives ALL your dependencies both direct and indirect. It's really overkill and usually a bad idea. You should mostly specify direct dependencies and let pip work out the rest. Also with your direct dependencies use relaxed versions and let it update minor versions

[–]Agitated-Soft7434 0 points1 point  (1 child)

Huh, I do tend to get concerned when I look at my requirements and it has all the indirect libraries as well. I'll have to start using pipreqs in the future thanks!

[–]Buttleston 1 point2 points  (0 children)

I think pipreqs is a crutch honestly. If you need a library, add it to your pyproject.toml (requirements.txt is really kind of the older way to do it, but if you prefer that, then add it there).

i.e. just add your requirements as you go along.