Pip: "Requirement not upgraded as not directly required" for packages that are up-to-date

Created on 19 Apr 2018  路  11Comments  路  Source: pypa/pip

  • Pip version: 10.0.0
  • Python version: 2.7.14
  • Operating system: Ubuntu 17.10

Description:

When I run pip install -U <package> for some package (e.g. ansible), pip outputs a lot of messages like

Requirement not upgraded as not directly required: jinja2 in /home/mg/.venv/lib/python2.7/site-packages (from ansible) (2.10)
Requirement not upgraded as not directly required: PyYAML in /home/mg/.venv/lib/python2.7/site-packages (from ansible) (3.12)
Requirement not upgraded as not directly required: paramiko in /home/mg/.venv/lib/python2.7/site-packages (from ansible) (2.4.1)
Requirement not upgraded as not directly required: cryptography in /home/mg/.venv/lib/python2.7/site-packages (from ansible) (2.2.2)
Requirement not upgraded as not directly required: setuptools in /home/mg/.venv/lib/python2.7/site-packages (from ansible) (39.0.1)
Requirement not upgraded as not directly required: MarkupSafe>=0.23 in /home/mg/.venv/lib/python2.7/site-packages (from jinja2->ansible) (1.0)
Requirement not upgraded as not directly required: pynacl>=1.0.1 in /home/mg/.venv/lib/python2.7/site-packages (from paramiko->ansible) (1.2.1)
Requirement not upgraded as not directly required: pyasn1>=0.1.7 in /home/mg/.venv/lib/python2.7/site-packages (from paramiko->ansible) (0.4.2)
Requirement not upgraded as not directly required: bcrypt>=3.1.3 in /home/mg/.venv/lib/python2.7/site-packages (from paramiko->ansible) (3.1.4)
Requirement not upgraded as not directly required: cffi>=1.7; platform_python_implementation != "PyPy" in /home/mg/.venv/lib/python2.7/site-packages (from cryptography->ansible) (1.11.5)
Requirement not upgraded as not directly required: enum34; python_version < "3" in /home/mg/.venv/lib/python2.7/site-packages (from cryptography->ansible) (1.1.6)
Requirement not upgraded as not directly required: idna>=2.1 in /home/mg/.venv/lib/python2.7/site-packages (from cryptography->ansible) (2.6)
Requirement not upgraded as not directly required: asn1crypto>=0.21.0 in /home/mg/.venv/lib/python2.7/site-packages (from cryptography->ansible) (0.24.0)
Requirement not upgraded as not directly required: six>=1.4.1 in /home/mg/.venv/lib/python2.7/site-packages (from cryptography->ansible) (1.11.0)
Requirement not upgraded as not directly required: ipaddress; python_version < "3" in /home/mg/.venv/lib/python2.7/site-packages (from cryptography->ansible) (1.0.19)
Requirement not upgraded as not directly required: pycparser in /home/mg/.venv/lib/python2.7/site-packages (from cffi>=1.7; platform_python_implementation != "PyPy"->cryptography->ansible) (2.18)

This makes me think these packages are outdated and would've been upgraded if I'd asked for --upgrade-strategy=eager, so then I try to pip install -U ipaddress (for example), and then I'm surprised by

Requirement already up-to-date: ipaddress in /home/mg/.venv/lib/python2.7/site-packages (1.0.22)

Would you mind omitting these "Requirement not upgraded ..." messages for requirements that are already up-to-date? And if that's not possible (because pip didn't reach to PyPI to check for the current version of that requirement), then would you mind rephrasing the message so it's less confusing?

awaiting PR auto-locked good first issue enhancement

Most helpful comment

Requirement already satisfied, not updated: req?

All 11 comments

would you mind rephrasing the message so it's less confusing?

I would suggest "Requirement not considered for upgrade as not directly required: ...".

(I wish I could come up with something shorter, but I'm stumped.)

"Transitive requirement satisfied:"?

It's not a transitive dependency: you're directly asking pip to upgrade ipaddress, and it's already up-to-date.

We're talking about the "Requirement not upgraded as not directly required" messages.

The "Requirement already up-to-date" one is perfectly fine.

Requirement already satisfied, not updated: req?

Requirement already satisfied, not updated: req

Happy to accept a PR for this. :)

If nobody wants to take it, I'd like to give it a go. Seems like a simple 1st issue.

@amorison Sure! Go ahead. :)

Requirement already satisfied: req ?
There is no point in 'not updated' part.

There is. It's been actively chosen (based on, the upgrade strategy) to not be upgraded as it was not explicitly requested by the user to be upgraded.

Now, that you point it out, it does not communicate the information in the right way.

"Requirement already installed, not checking version: " would be better wording, if we want to make it terse.

/cc @amorison

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

Was this page helpful?
0 / 5 - 0 ratings