Open thisisreallife opened 3 years ago
Does pip install
ever ask a y/n question? pip uninstall
does, and it indeed has a -y
option. Accepting -y
when no y/n question is asked sounds wrong to me.
Does
pip install
ever ask a y/n question?pip uninstall
does, and it indeed has a-y
option. Accepting-y
when no y/n question is asked sounds wrong to me.
When we try to pip install some_package
, system may try to figure out the dependency of packages. In that situation, pip may want to uninstall/update some_other_packages
and then proceed the original pip install some_package
, which may ask user to type y/n
to proceed the progress or stop from there.
In that situation, pip may want to uninstall/update some_other_packages and then proceed the original
pip install some_package
I don’t think it does? pip intentionally uninstalls packages without user prompts in this situation (which some people consider problematic, see #9646).
Does
pip install
ever ask a y/n question?pip uninstall
does, and it indeed has a-y
option. Accepting-y
when no y/n question is asked sounds wrong to me.
When you add a package outside of PyPi (e.g. bitbucket.org) it does. If the host is not in the known_hosts for example
Do you have an example?
Do you have an example?
I came across this the other day, you can just see where ask
is referenced: https://github.com/pypa/pip/blob/22.3.1/src/pip/_internal/utils/misc.py#L186
I believe boris-donchev is referring to this specific case: https://github.com/pypa/pip/blob/22.3.1/src/pip/_internal/network/auth.py#L243 which can come up any time a 401 responds from a network request.
IMO a better solution would be to remove ask
, and replace each instance where it's used with a specific CLI flag to accept it otherwise fail.
Conda which provides global -y
and -n
flags does this because it is expected by default there will be user interaction. The problem with providing -y
though when you're automating conda is you miss cases where a prompt comes up that you would rather error on.
But that's my two cents.
pip version
0.21
Python version
3.6
OS
macos
Additional information
No response
Description
Sometimes pip ask user to type
y/n
into terminal , determining whether to go further.-y
/--yes
means automatically yes. However, in the new version of pip, it saysno such option: -y
Expected behavior
No response
How to Reproduce
pip install python-louvain -y
Output
Code of Conduct