Describe the bug
A fresh install with Python 3.11.9 and pip 24.1.2 causes pigar to fail when invoked from command-line: ModuleNotFoundError: No module named 'pip._vendor.chardet'
To Reproduce
Steps to reproduce the behavior:
Install and activate a fresh conda environment with Python 3.11.9
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\myusername\work\mambaforge\envs\py311env\Scripts\pigar.exe\__main__.py", line 4, in <module>
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\__main__.py", line 12, in <module>
from .log import enable_pretty_logging, logger
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\log.py", line 3, in <module>
from .helpers import Color
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\helpers.py", line 13, in <module>
from ._vendor.pip._internal.req.req_file import get_file_content
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\_vendor\pip\_internal\req\__init__.py", line 5, in <module>
from pigar._vendor.pip._internal.utils.logging import indent_log
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\_vendor\pip\_internal\utils\logging.py", line 29, in <module>
from pigar._vendor.pip._internal.utils.misc import ensure_dir
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\_vendor\pip\_internal\utils\misc.py", line 43, in <module>
from pigar._vendor.pip._internal.exceptions import CommandError, ExternallyManagedEnvironment
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\_vendor\pip\_internal\exceptions.py", line 18, in <module>
from pigar._vendor.pip._vendor.requests.models import Request, Response
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\_vendor\pip\_vendor\requests\__init__.py", line 149, in <module>
from . import packages, utils
File "C:\Users\myusername\work\mambaforge\envs\py311env\Lib\site-packages\pigar\_vendor\pip\_vendor\requests\packages.py", line 8, in <module>
locals()[package] = __import__(vendored_package)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'pip._vendor.chardet'
Expected behavior
The command should run successfully and not raise ModuleNotFoundError
Context (Environment)
OS: Windows 10
Version of Python: 3.11.9
Version of pigar: 2.1.4
Additional context
Forcing a downgrade of pip to 20.3 made the error go away. Obviously not a long term solution.
As best I can tell, this error is due to pip dropping its vendoring of the chardet library sometime between versions 20.3 and 24.1.
Describe the bug A fresh install with Python 3.11.9 and pip 24.1.2 causes
pigar
to fail when invoked from command-line:ModuleNotFoundError: No module named 'pip._vendor.chardet'
To Reproduce Steps to reproduce the behavior:
python -m pip install -U pip
pigar
:python -m pip install pigar
pigar generate
Expected behavior The command should run successfully and not raise
ModuleNotFoundError
Context (Environment)
Python
: 3.11.9pigar
: 2.1.4Additional context
Forcing a downgrade of
pip
to 20.3 made the error go away. Obviously not a long term solution.As best I can tell, this error is due to
pip
dropping its vendoring of thechardet
library sometime between versions 20.3 and 24.1.See here: https://github.com/pypa/pip/tree/main/src/pip/_vendor :
chardet
is no longer vendored.