Invalid `use-feature` value breaks pip
See original GitHub issueEnvironment
- pip version: 20.2
- Python version: 3.7.7
- OS: Fedora 30
Description
I made a bad guess for the syntax of how to enable two pip features permanently, and rendered pip completely broken with a simple pip config set
command.
Expected behavior One or both of the following:
- a syntax check when doing
pip config set
would reject an invalid value - the invalid configuration value would be a warning and still let pip continue
How to Reproduce
- Enable a non-existing feature using
pip config set global.use-feature <feature>
- Try to use any pip subcommand (or just
pip
) - Pip crashes with an error message
Output
$ pip config set global.use-feature 2020-resolver,fast-deps
Writing to /home/akaihola/.config/pip/pip.conf
$ pip
An error occurred during configuration: option use-feature: invalid choice: '2020-resolver,fast-deps' (choose from '2020-resolver', 'fast-deps')
$ pip config unset --user global.use-feature
An error occurred during configuration: option use-feature: invalid choice: '2020-resolver,fast-deps' (choose from '2020-resolver', 'fast-deps')
The work-around:
$ rm $HOME/.config/pip/pip.conf
Issue Analytics
- State:
- Created 3 years ago
- Reactions:6
- Comments:12 (12 by maintainers)
Top Results From Across the Web
User Guide - pip documentation v22.3.1
It will be stricter - if you ask pip to install two packages with incompatible requirements, it will refuse (rather than installing a...
Read more >What does the error message about pip --use-feature=2020 ...
According to this announcement, pip will introduce a new dependency resolver in October 2020, which will be more robust but might break some ......
Read more >User Guide - pip documentation v21.1.dev0
Certain special characters are not valid in the authentication part of URLs. ... It is possible to append values to a section within...
Read more >pipenv Documentation - Read the Docs
pipenv sync --extra-pip-args="--use-feature=truststore --proxy=127.0.0.1" ... Fix a bug that invalid Python paths from Windows registry break pipenv install ...
Read more >How to Setup Your Python Environment for Machine Learning ...
Alternatively, you may choose to install using pip and a specific ... with installing scikit learn. getting a syntax error: invalid syntax.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
You don’t have to use newlines; any space would do (pip just splits with
str.split()
).I just checked, it seems like
--isolated
only applies to distutils config files (a historical artifact that I don’t think many ever used), not pip config files.All pip configuration files are always loaded; you can see the function that gets those files received no flags at all:
https://github.com/pypa/pip/blob/ea10d0e253f497c9fc08097f14cdba6b94b45541/src/pip/_internal/configuration.py#L76-L96
We should have a discussion on this 🙁 But also independent to this issue.