Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"WARNING: Value for scheme.data does not match" when I try to update pip or install packages

I have a M1 Mac and I just noticed that when I try to upgrade pip or install any packages I get a series of warnings:

user@mac01 ~ $python3 -m pip install --upgrade pip
WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew/lib/python3.9/site-packages
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew/lib/python3.9/site-packages
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew/include/python3.9/UNKNOWN
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9
WARNING: Value for scheme.scripts does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew/bin
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/bin
WARNING: Value for scheme.data does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9
WARNING: Additional context:
user = False
home = None
root = None
prefix = None
Requirement already satisfied: pip in /opt/homebrew/lib/python3.9/site-packages (21.1)
WARNING: Value for scheme.platlib does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew/lib/python3.9/site-packages
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
WARNING: Value for scheme.purelib does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew/lib/python3.9/site-packages
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages
WARNING: Value for scheme.headers does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew/include/python3.9/UNKNOWN
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/include/python3.9
WARNING: Value for scheme.scripts does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew/bin
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9/bin
WARNING: Value for scheme.data does not match. Please report this to <https://github.com/pypa/pip/issues/9617>
distutils: /opt/homebrew
sysconfig: /opt/homebrew/opt/[email protected]/Frameworks/Python.framework/Versions/3.9
WARNING: Additional context:
user = False
home = None
root = None
prefix = None
user@mac01 ~ $

Please advise.

like image 233
daquezada Avatar asked Apr 24 '21 15:04

daquezada


People also ask

Why is pip install not working in Python?

One of the most common problems with running Python tools like pip is the “not on PATH” error. This means that Python cannot find the tool you're trying to run in your current directory. In most cases, you'll need to navigate to the directory in which the tool is installed before you can run the command to launch it.

How do I manually update pip?

Updating Pip b is available.” You can run “pip install --upgrade pip” to install and use the new version of pip. To update pip2 or pip3 using this command, only replace the first pip with the pip version.

How do I update pip Index?

go to command prompt. and use this command. python -m pip install -–upgrade pip. Dont forget to restart the editor,to avoid any error.

Is this Pip warning unnecessary?

It's unnecessary IMO, but you can pick your poison (some warnings to ignore vs older pip version). For those who want to understand more: This warning was added because we wanted to surface issues that might take place, when we make a transition in the future.

How do I suppress a specific error in Pip?

You can suppress pedantic warnings by using pip install foo 2>nul on Windows, or pip install foo 2>/dev/null on Linux. However, be warned: this will also suppress important errors.

Is it safe to install older versions of Pip?

You can safely use the current pip, ignoring this warning for now. For those who want a quick answer to silencing this warning: python -m pip install pip== {some-older-version} -- you can pin to an older version of pip for now. It's unnecessary IMO, but you can pick your poison (some warnings to ignore vs older pip version).

What is the latest Pip version?

You can check what the latest pip version is here and decide whether to update accordingly. At the time of writing, the latest pip version is 22.0.4. Our server is on 20.0.2, so an upgrade is definitely in order.


4 Answers

(A pip maintainer here!)

This warning is not harmful per-se, and doesn't affect any installation logic. You can safely use the current pip, ignoring this warning for now.

For those who want a quick answer to silencing this warning: python -m pip install pip=={some-older-version} -- you can pin to an older version of pip for now. It's unnecessary IMO, but you can pick your poison (some warnings to ignore vs older pip version).


For those who want to understand more: This warning was added because we wanted to surface issues that might take place, when we make a transition in the future.

For historical reasons (uhm... Python 2), pip has used distutils.sysconfig to get information about where to install your Python packages. That module can be functionally replaced by sysconfig that was added to the Python standard library in Python 3.2. However, Python distributors patch it (and not sysconfig) to provide an alternative “default install scheme”.

PEP 632 deprecates distutils, and it is going to be removed from the Python standard library. distutils-based installations is something that the Python packaging community has been trying to deprecate and remove for a while.

We've been working with a lot of distributors to get them to fix their patches, so that installations in the future can transition to using sysconfig as their source of truth. This message is a part of our "get information from users of broken Python installations". As you've probably noticed, Python installations with differently configured distutils.sysconfig and sysconfig are exceedingly more common than we'd expected. :)

Update: Newer versions of pip (>21.1.1) should present these messages much less often. If you're still seeing these messages, please look at the issue that the message contains.

like image 159
pradyunsg Avatar answered Oct 22 '22 23:10

pradyunsg


downgrading to an earlier version of pip fixed it for me:

python -m pip install pip==21.0.1

like image 78
EmilMachine Avatar answered Oct 22 '22 21:10

EmilMachine


For those who failed to run python -m pip install pip==21.0.1 (for example returned the same error message like ValueError: check_hostname requires server_hostname), you can try to disable the system proxy and retry the command (If you were using some proxy like shadowsocks, v2ray, etc).

like image 1
laoyb Avatar answered Oct 22 '22 22:10

laoyb


Have you tried running it from a virtual environment?

python3 -m venv venv
source ./venv/bin/activate
pip install --upgrade pip
like image 1
Bicameral Mind Avatar answered Oct 22 '22 22:10

Bicameral Mind