Pip: Add name-only option in `pip freeze`

Created on 1 Oct 2019  路  11Comments  路  Source: pypa/pip

What's the problem this feature will solve?

To display all installed package without version details.

Describe the solution you'd like

pip freeze --simple, then all names of installed packages will be listed without version numbers.

Alternative Solutions

There is a way to use gawk to eliminate version string after ==, but it is too complicated.
Additional context

needs discussion feature request

Most helpful comment

I'm also -1 on this feature.
I would more easily accept this feature as a new --format name value for pip list.
But even there, you could pip list --format json | jq -r .[].name :man_shrugging:

All 11 comments

Is this something that I can take up? I would like to start contributing to pip.

To the alternative solutions: pip freeze | sed 's/==.+$//'.

@atugushev , Even if it is shorter than gawk, but it is still complicated.

What is the use case for this feature?

@aritra24, I would check out any issues labeled "good first issue" - that would be a good place to start!

@chrahunt ,

Firstly, the user can have a brief view about what packages have been installed.

Secondly, with pip install -U $(pip freeze simple), all package can be updated. For some new started scientific project, if several dependencies have been updated, it would be good idea to follow new one.

Thirdly, Usually, there will not be so strict limitation on dependency version. So a name-only dep-list would be a good idea.

Hmm... All of that can be covered by pip freeze | sed 's/==.+$//' (or equivalent on windows, but given that you're using $() syntax, you're not affected by that). This is especially true since you can make the assumptions about the environment, like that there are no editable installs from a VCS repository -- edge cases like this have to be covered by any option we add to pip freeze for example.

I'm not convinced that these use cases are common enough to justify adding more complexity to pip.


While this is functionally simple, there's a line to be drawn somewhere about what amount of knobs/levers we can have on a tool until it gets overwhelming. I don't think this knob justifies the addition of complexity.

I'm also -1 on this feature.
I would more easily accept this feature as a new --format name value for pip list.
But even there, you could pip list --format json | jq -r .[].name :man_shrugging:

Hi @pradyunsg , @xavfernandez

Are we still open to accepting a PR w.r.t this issue with pip freeze --format name to just list packages with names and without their versions?

Also the suggestion pip list --format json | jq -r .[].name works on my Mac, but not pip freeze | sed 's/==.+$//'

Instead pip freeze | sed 's/==.*//' works on my Mac, but only if you don't have editable installs.

@deveshks according to the two previous comments this feature if wanted, would be in pip list rather than pip freeze. IMO too, it is not worth the added complexity because there is an easy solution via pip list --format json | jq and because the use case invoked will eventually be addressed with improved upgrade strategies.

it is not worth the added complexity because there is an easy solution via pip list --format json | jq and because the use case invoked will eventually be addressed with improved upgrade strategies.

Agreed, in that case, we can close this issue.

Was this page helpful?
0 / 5 - 0 ratings