2
votes

Whenever I try using pip3 or anything that contains pip3, ModuleNotFoundError: No module named 'pip._vendor.packaging.about' pops up. I used it to install opencv and used opencv for multiple projects yesterday. I have no idea why the error popped up today.

Here's my code :

kaushiksankar@Kaushiks-MacBook-Pro ~ % pip3 install opencv-python Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.9/bin/pip3", line 5, in from pip._internal.cli.main import main File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 10, in from pip._internal.cli.autocompletion import autocomplete File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 9, in from pip._internal.cli.main_parser import create_main_parser File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 7, in from pip._internal.cli import cmdoptions File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/cmdoptions.py", line 23, in from pip._internal.cli.progress_bars import BAR_TYPES File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/cli/progress_bars.py", line 12, in from pip._internal.utils.logging import get_indentation File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 17, in from pip._internal.utils.deprecation import DEPRECATION_MSG_PREFIX File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_internal/utils/deprecation.py", line 13, in from pip._vendor.packaging.version import parse File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip/_vendor/packaging/init.py", line 6, in from .about import ( ModuleNotFoundError: No module named 'pip._vendor.packaging.about'

Using MacOS I cannot find the version of pip by any method. pip command cannot be used, hence used pip3. Any help will be highly appreciated

TIA

1

1 Answers

1
votes

Download the get-pip.py file and store it in the same directory as python is installed. Or use the following command to download pip directly,

  wget https://bootstrap.pypa.io/get-pip.py -o get-pip.py

Now execute the downloaded file using below command

  python3 get-pip.py

One can easily verify if the pip has been installed correctly by performing a version check on the same. Just go to the command line and execute the following command:

  pip3 --version

After that you can install your package

  pip3 install package_name