pip icon indicating copy to clipboard operation
pip copied to clipboard

Only emit a metadata warning once

Open uranusjr opened this issue 3 years ago • 8 comments

From https://github.com/pypa/pip/issues/11352#issuecomment-1238235954

BTW, the warning is quite noisy:

[root@9a62f3789682 /]# mkdir -p /usr/lib64/python3.11/site-packages/mercurial-6.2-py3.11.egg-info
[root@9a62f3789682 /]# pip list
WARNING: Skipping /usr/lib64/python3.11/site-packages/mercurial-6.2-py3.11.egg-info due to invalid metadata entry 'name'
Package    Version
---------- --------
gpg        1.17.0
libcomps   0.1.18
pip        22.2.2
rpm        4.18.0b1
setuptools 62.6.0
WARNING: Skipping /usr/lib64/python3.11/site-packages/mercurial-6.2-py3.11.egg-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/lib64/python3.11/site-packages/mercurial-6.2-py3.11.egg-info due to invalid metadata entry 'name'
WARNING: Skipping /usr/lib64/python3.11/site-packages/mercurial-6.2-py3.11.egg-info due to invalid metadata entry 'name'

Can this be improved with better caching? Or switching to use ResourceWarning?

uranusjr avatar Sep 06 '22 17:09 uranusjr

same here, any solution?

yaoyhu avatar Mar 29 '23 15:03 yaoyhu

same here, any solution?

rm -rf $NOISY_DIR_NAME

yaoyhu avatar Mar 29 '23 15:03 yaoyhu

Feel free to contribute. I imagine this can be improved by caching the metadata-parsing function (that emits this message), or by maybe using warnings instead.

uranusjr avatar Mar 30 '23 09:03 uranusjr

Feel free to contribute. I imagine this can be improved by caching the metadata-parsing function (that emits this message), or by maybe using warnings instead.

I "fixed" this by finding the package and uninstalling it using pip. But it still gives warnings. So I rm -rf that dir and reinstall the package by pip. It works and has no harmful impact for now.

yaoyhu avatar Mar 30 '23 09:03 yaoyhu

Why am I starting to get these warnings all the time over the past few months? Anyone know what changed? Often I get these warnings for Python packages installed by MacPorts

huyz avatar Sep 28 '23 06:09 huyz

Why am I starting to get these warnings all the time over the past few months? Anyone know what changed? Often I get these warnings for Python packages installed by MacPorts

The same issue can occur with Python packages installed via Homebrew. You can attempt to uninstall them using Macports/Homebrew and then reinstall them using pip. However, certain packages are necessary dependencies for software such as vim. Therefore, you will have to tolerate this situation for now.

yaoyhu avatar Sep 28 '23 06:09 yaoyhu

For what it's worth as others stumble on this, I just pip uninstall [name] then pip install [name] and the errors went away. I did not have to rm -rf the directory.

I'd also like to understand why this just started out of the blue?

jwhendy avatar Jan 11 '24 20:01 jwhendy

In my recent homebrew build of python, it appeared to be specific to python3.12 I installed python3.11 and built the virtual environment with that (python3.11 -m venv venv) Doing a pip install in this 3.11-based environment worked for me.

itd avatar Apr 13 '24 16:04 itd