pip: “Value for [key] does not match” warnings in pip 21.2
This is spun off #9617 to aggregate user feedback for another round of pip’s location backend switch from distutils
to sysconfig
. If you find yourself seeing something like:
WARNING: Value for scheme.scripts does not match. Please report this to <https://github.com/pypa/pip/issues/10151
What you need to do?
- Check your version of pip. New reports that don’t mention the pip version, or against versions before 21.2.4 will be ignored.
- Comment below with content like this so we can learn about your environment:
Output of 'pip debug':
```
pip version: pip X.Y.Z from /....
sys.version: ...
sys.executable: /path/to/python
...
```
Error output:
```
WARNING: Value for [location-key] does not match. Please report this to ...
distutils: /xxxxx
sysconfig: /yyyyy
WARNING: Additional context:
user = False
home = None
root = None
prefix = None
```
Please:
- Upgrade to pip 21.2.4 or higher and fill the template above.
- Do not post screenshots.
- Always wrap the error output in code block (a pair of three backticks
```
) like the above format. - Once you posted your comment, you can unsubscribe to this issue (but you’re welcomed to stay if you’re inclined to). We will @ you once a fix is available for your specific environment so you can test the fix.
Additional information for those interested:
- This is not an error, you can safely ignore the message. The warning is a means to allow pip developers gather information about environments that may have issues when we switch the location backend.
- Python is going to deprecate distutils in the 3.10 release, with the intention to remove it in 3.12. Therefore, pip is trying to rewrite logic that uses distutils with alternative means provided by the Python standard library. However, distutils contains a lot of legacy edge cases that is difficult to cover, so we are trying to gather information on those edge cases we do not know yet. Once we know about them, we will fix them, so when 3.12 lands everyone can switch to the new location backend without anything breaking.
- If the warning message causes your workflow to fail (due to an organisational no-warning restriction, for example), you can set the
_PIP_LOCATIONS_NO_WARN_ON_MISMATCH=1
environment variable to suppress this warning. The message will only be visible withpip -vv
(and to stdout instead of stderr) with this flag set.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Reactions: 33
- Comments: 467 (75 by maintainers)
Commits related to this issue
- Bump pip from 21.1.3 to 21.2.1 (PR #3139) Bumps [pip](https://github.com/pypa/pip) from 21.1.3 to 21.2.1. <details> <summary>Changelog</summary> <p><em>Sourced from <a href="https://github.com/pypa/p... — committed to inmanta/inmanta-core by inmantaci 3 years ago
- Suppress warnings from https://github.com/pypa/pip/issues/10151 — committed to mendix/cf-mendix-buildpack by markbastiaans 3 years ago
- Suppress warnings from https://github.com/pypa/pip/issues/10151 — committed to mendix/cf-mendix-buildpack by markbastiaans 3 years ago
- Suppress warnings from https://github.com/pypa/pip/issues/10151 (#458) — committed to mendix/cf-mendix-buildpack by markbastiaans 3 years ago
- Suppress warnings from https://github.com/pypa/pip/issues/10151 (#458) — committed to mendix/cf-mendix-buildpack by markbastiaans 3 years ago
While installing requirements.txt for a Django project I am getting this warning.
sigh
Please don’t devolve this thread into a sequence of memes. This is a very targeted issue, for getting user inputs on a very specific issue – gathering inputs from users, about mismatches in the
distutils.sysconfig
paths vssysconfig
paths.If you wish to post memes or do anything else that’s similarly off topic, please do that somewhere else. This isn’t r/ProgrammerHumor, nor is this r/Python.
Regarding the rant about how setting up a “proper” Python environment is difficult – I’m sure folks over on python-tutor and #help-* on the Python Discord would be more than happy to help you out.
I appreciate and empathize with the problems of getting Python set up in “the right way” on a machine. There are gonna be 3-30 of ways to get Python on any platform, and it’s often possible to get Python installations from multiple places. The resources on the internet all suggest different things, and have contradicting suggestions. All of this is exceedingly annoying if you also have a messed up PATH situation, where
pip
andpython
are actually not from the same installation. One important thing I’ll flag, is that if you’re confused about what is happening, usepython -m pip
/python3 -m pip
etc; instead ofpip
directly. None the less, this isn’t the right place to discuss the implications of all this though, and I hope that something like https://github.com/pypa/pip/issues/3164#issuecomment-398216682 will improve the story on these fronts.Could you all not make the code smaller in for example in a spoiler. You make the “Issue Post” especially confusing, so that we certainly must open a new “Issue Post”. Just the scrolling ist fucking annoying. Why when you see that a person, who have the same issue, how you, why you post your issue report. Instead you give the person a thumps up oder similar. I really don´t unterstand it.
Hey, let’s focus on fixing what needs to be fixed, please 🙂
Once you reported your issue, you can safely unsubscribe to this thread so you don’t get bombarded by further notifications. I am actively categorising reports in this thread into separate issues, and will ping people in the ones to them relevant. You are not going to miss things that matter to you, I promise.
I figured the problem out.
distutils.get_python_lib()
does not use the install schemes at all. It joins the paths together by assumptions and glue:https://github.com/python/cpython/blob/3.10/Lib/distutils/sysconfig.py#L309
I hate this. Glad that pip 21.3 uses sysconfig directly. Thanks for your help!
Deadsnakes is backporting the upstream Debian/Ubuntu package, and there’s a bug in the upstream. I’ve filed this to https://bugs.launchpad.net/ubuntu/+source/python3.10/+bug/1940705
People, please read the first post in this thread and supply information about your environment. If you don’t, I’ll just assume you’re running 21.2.1 and ignore your report.
@KanTakahiro @siddhpant Interesting… So it seems like this mismatch only happens when you build from source for the first time. I’ll need to investigate more. Many thanks, both your inputs are super helpful.
Yes. CentOS 8 will be EOL at the end of 2021, Rocky Linux 8 will be a rebuild of RHEL 8 until 2029.
The general suggestions should be:
/usr/bin
, talk to your Linux distributor e.g. Red Hat; it’s their bug.)@DiddiLeija sorry about this, thought I had upgraded pip and didnt verify this first. RHEL 9 is shipping with 21.2.3, you can disregard mine.
Was compiling python3 for Raspberry Pi 3, and it spit out this error
While building Python-3.9.9 on AIX - “make install” when using DESTDIR reports:
error
section in the debug output, so the message above may only be occuring as part of themake install
process (in particular to a DESTDIR)@uranusjr , I sent you a private email.
Output of
pip debug
Error Output:
Hi, I got the following message that tells to post the issue here, so I do. I installed python3.10 from the ‘deadsnakes PPA’. This is an Azure Ubuntu VM.
This is at the end for python.3.10 build in Linux: WARNING: Value for scheme.headers does not match. Please report this to https://github.com/pypa/pip/issues/10151 distutils: /common/dev/slevin/tools/Python.3.10.0/include/python3.10/UNKNOWN sysconfig: /common/dev/slevin/distrib/Python-3.10.0/Include/UNKNOWN WARNING: Additional context: user = False home = None root = ‘/’ prefix = None Looking in links: /tmp/tmp61lc_79p Processing /tmp/tmp61lc_79p/setuptools-57.4.0-py3-none-any.whl Processing /tmp/tmp61lc_79p/pip-21.2.3-py3-none-any.whl Installing collected packages: setuptools, pip WARNING: Value for scheme.headers does not match. Please report this to https://github.com/pypa/pip/issues/10151 distutils: /common/dev/slevin/tools/Python.3.10.0/include/python3.10/setuptools sysconfig: /common/dev/slevin/distrib/Python-3.10.0/Include/setuptools WARNING: Value for scheme.headers does not match. Please report this to https://github.com/pypa/pip/issues/10151 distutils: /common/dev/slevin/tools/Python.3.10.0/include/python3.10/pip sysconfig: /common/dev/slevin/distrib/Python-3.10.0/Include/pip WARNING: The scripts pip3 and pip3.10 are installed in ‘/common/dev/slevin/tools/Python.3.10.0/bin’ which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed pip-21.2.3 setuptools-57.4.0
Here we go again. In Fedora, we have recently changed our patch of distutils to patch sysconfig instead. The details are in https://lists.fedoraproject.org/archives/list/python-devel@lists.fedoraproject.org/thread/AAGUFQZ4RZDU7KUN4HA43KQJCMSFR3GW/
I was afraid this will break things, but we have thoroughly tested almost everything we could and it worked. Until a fellow Fedoran told me their test is failing in upstream CI: https://github.com/rhinstaller/anaconda/runs/3876995865?check_suite_focus=true
Note that this is Python 3.10, so distutils reads the information from sysconfig. I expected no mismatches. Yet we get them:
I honestly have no idea what’s happening here. The new version of pip that uses just sysconfig works fine so we will likely resolve this issue by upgrading, but I am still perplexed how can the distutils path differ from the sysconfig one.
Running
sudo make install
on a freshly-updated CPython.Output of
pip debug
:Error output:
Those you mentioned are fine. Only those configuring build and installation locations (where should files go on your computer) are deprecated.
@truongsondq Could you post this to #10270 as well?
‘’’ WARNING: Value for scheme.headers does not match. Please report this to http://github.com/pypa/pip/issues/10151 distutils: /usr/local/python3/include/python39/UNKNOWN sysconfig: /home/devel/Python-3.9.7/Include/UNKNOWN WARNING: additional context: user = False home = None root = ‘/’ prefix = None Looking in links: /tmp/tmpfwc215is ‘’’
Funny you say that because the warning provides a URL that points directly to this issue and instructs the user to report the warning here. That URL should be visible in my original report above.
Looks like another CPython bug;
posix_home
should also use{platlibdir}
instead of hardcodinglib
. I’ll raise this to CPython.Update: Reported as https://bugs.python.org/issue45035
Thanks! I dug around and this seems to be a CPython bug. I will report this upstream and try to suppress this warning for 3.9 (the only version affected; this bug was introduced by the addition of
sys.platlibdir
, which is used bysysconfig
’sposix_user
scheme, but notdistutils
’s equivalentunix_user
scheme).$
which pip
$
pip debug
$
rm -rf venv ; /usr/bin/python -m venv venv ; pip install flask
Note the lack of activate: user is accidentally invoking system pipI am no longer seeing my above reported error/warning output
@uranusjr Can’t seem to find comment to edit it, so here is info here. First one: Ubuntu budgie Result of
cat /etc/os-release
Second one: Raspbian buster Result of
cat /etc/os-release
@shotty1 @benelgiac @acere Please post the warning message you are seeing.
@siddhpant What is the command you use when you see the first warning? (the
pycairo
one; the second one I think I know the issue, will ping you in another thread)@stephan-cr Can you confirm if the setup mentioned in https://github.com/pypa/pip/issues/10151#issuecomment-888647104 is the same as yours?
@Julien-athstat Do you know what OS is Amazon Cloud9 running on? (The paths look like Ubuntu? But the GCC info says Red Hat…)
@msapiro @mdmintz Wow that’s new! It’s definitely not been reported previously. Those look equivalent, it seems like we shouldn’t show the warning to you in the first place. Could you describe how you set up the environment?
@paulathomas Seems like you hit a bug in GitHub’s rendering engine; I copied the test to a code editor, re-formatted the lines (delete the newline and re-hit enter) and it seems to work now.
@SlidingHorn Yes.
ubuntu 20.04
Hi! using pip to install pysyd:
Output of ‘pip debug’:
Error output: Requirement already satisfied: pysyd in ./Library/Python/3.8/lib/python/site-packages (1.6.6)
Requirement already satisfied: scipy==1.5.1 in ./Library/Python/3.8/lib/python/site-packages (from pysyd) (1.5.1 )
Requirement already satisfied: matplotlib>=1.5.3 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/ lib/python3.8/site-packages (from pysyd) (3.4.2)
Requirement already satisfied: pandas>=1.0.5 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/ python3.8/site-packages (from pysyd) (1.3.0)
Requirement already satisfied: numpy>=1.16 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/py thon3.8/site-packages (from pysyd) (1.21.1)
Requirement already satisfied: astropy>=4.0.0 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib /python3.8/site-packages (from pysyd) (4.2.1)
Requirement already satisfied: pyerfa in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3 .8/site-packages (from astropy>=4.0.0->pysyd) (1.7.2)
Requirement already satisfied: cycler>=0.10 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/p ython3.8/site-packages (from matplotlib>=1.5.3->pysyd) (0.10.0)
Requirement already satisfied: kiwisolver>=1.0.1 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/ lib/python3.8/site-packages (from matplotlib>=1.5.3->pysyd) (1.3.1)
Requirement already satisfied: pillow>=6.2.0 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/ python3.8/site-packages (from matplotlib>=1.5.3->pysyd) (8.3.1)
Requirement already satisfied: pyparsing>=2.2.1 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/l ib/python3.8/site-packages (from matplotlib>=1.5.3->pysyd) (2.4.7)
Requirement already satisfied: python-dateutil>=2.7 in /opt/local/Library/Frameworks/Python.framework/Versions/3 .8/lib/python3.8/site-packages (from matplotlib>=1.5.3->pysyd) (2.8.2)
Requirement already satisfied: six in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/ site-packages (from cycler>=0.10->matplotlib>=1.5.3->pysyd) (1.16.0)
Requirement already satisfied: pytz>=2017.3 in /opt/local/Library/Frameworks/Python.framework/Versions/3.8/lib/p ython3.8/site-packages (from pandas>=1.0.5->pysyd) (2021.1)
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/1015 1>
distutils: /Users/cosmicbabs/Library/Python/3.8/include/python3.8/UNKNOWN
sysconfig: /Users/cosmicbabs/Library/Python/3.8/include/UNKNOWN
WARNING: Additional context: user = True home = None root = None prefix = None
This is coming from a CI build of a Dockerfile outside of my control, so running
pip debug
may be tricky.@uranusjr Edited adding the warning message I get, seems to be the same no matter what I try to install. This is just a pip update attempt
pip debug output on Ubuntu 20.04.2
@DarrienG Rocky Linux is the community version of new RHEL similar to CentOS 7 was to old RHEL versions, right? I’m trying to get an idea where to categories it under.
@uranusjr edited now, sorry.
@uranusjr sorry about that, edited.
@uranusjr Yes, correct:
sudo port install python39
MacPorts (per default setting) keeps everything separated in
/opt/local/
and not mix it in/usr/local/
to avoid conflicts with other installed packages.@uranusjr,
Nope, forgot the obligatory
export
in my.bashrc
. 😃 doh!When I tested the
_PIP_LOCATIONS_NO_WARN_ON_MISMATCH=0
value, it was in the shell itself and not (exported) in.bashrc
. Sorry for the noise.@allenatdecisiv Any non-empty value of
_PIP_LOCATIONS_NO_WARN_ON_MISMATCH
, including both0
, and1
, should do exactly the same:https://github.com/pypa/pip/blob/a196b3bf013a63f348e175e0e871f51f170f8abb/src/pip/_internal/locations/__init__.py#L38-L41
So you probably made a typo.
Updated.