question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Invalid `use-feature` value breaks pip

See original GitHub issue

Environment

  • 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

  1. Enable a non-existing feature using pip config set global.use-feature <feature>
  2. Try to use any pip subcommand (or just pip)
  3. 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:open
  • Created 3 years ago
  • Reactions:6
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

3reactions
uranusjrcommented, Aug 4, 2020

You don’t have to use newlines; any space would do (pip just splits with str.split()).

2reactions
uranusjrcommented, Aug 13, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found