Pip: ModuleNotFoundError: No module named 'pip._vendor' after upgrading pip

Created on 13 Feb 2019  ·  12Comments  ·  Source: pypa/pip

Environment

Description
After upgraded, pip can not be used. It produced the error "ModuleNotFoundError: No module named 'pip._vendor' "

What I have run

> pip
Traceback(most recent call last):
  File "D:\python\Scripts\pip-script.py", line 11, in <module>
    load_entry_point('pip==19.0.2', 'console_scripts', 'pip')()
  File "d:\python\lib\site-packages\pkg_resources\__init__.py", line 480, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "d:\python\lib\site-packages\pkg_resources\__init__.py", line 2693, in load_entry_point
    return ep.load()
  File "d:\python\lib\site-packages\pkg_resources\__init__.py", line 2324, in load
    return self.resolve()
  File "d:\python\lib\site-packages\pkg_resources\__init__.py", line 2330, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "d:\python\lib\site-packages\pip\_internal\__init__.py", line 19, in <module>
    from pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError: No module named `'pip._vendor'
auto-locked awaiting response support

Most helpful comment

I did the following on linux;

rm -rf /usr/lib/python3.7/site-packages
python3.7 -m ensurepip
pip install --upgrade pip

Hopefully it helps someone!

All 12 comments

I did the following on linux;

rm -rf /usr/lib/python3.7/site-packages
python3.7 -m ensurepip
pip install --upgrade pip

Hopefully it helps someone!

Hopefully it helps someone!

It just helped me, thanks!

Hopefully it helps someone!

It just helped me, thanks!

Thanks @CDuPlooy, it helped me too.

I did the following on linux;

rm -rf /usr/lib/python3.7/site-packages
python3.7 -m ensurepip
pip install --upgrade pip

Hopefully it helps someone!

You need only remove the pip package and not all the installed packages in site-packages!

rm -rf /usr/lib/python3.7/site-packages/pip
python3.7 -m ensurepip
pip install --upgrade pip

Which version of pip did you upgrade from?

Which version of pip did you upgrade from?

In my case I think it is some sort of clash between the python-pip installed via package manager (I'm using arch distro) and pip when installed using ensurepip i guess?
That's currently the only way I'm able to reproduce the issue.

I'm arch user too. python-pip 18.1-2 is available containing a hotfix: https://git.archlinux.org/svntogit/packages.git/commit/trunk?h=packages/python-pip&id=51bf0ae527118975b1c7d7b3856afb9e07e63324.
Follow this issue on Arch forums: https://bbs.archlinux.org/viewtopic.php?id=244720

On 5.0.3-arch1-1-ARCH with pip-19.0.3

I fixed the issue by

  1. Uninstalling pip and removing related files using the package manager
    yay -Rscn python-pip

  2. followed it by an install using the package manager (pip-18.1)
    yay -S python-pip

  3. Followed by a upgrade pip, from the installed pip-18.1 to pip-19.0.3
    pip install --upgrade pip

In my case, deleting /usr/lib/python3.7/site-packages/pip and reinstalling Python-pip with pacman fixed the issue. (I've installed python-pip 18.1-2)

我是窗口,提示有1.1.1更新,,怎么试都不行,弄了一天,报错:从点子。内部导入主要作为主#isort:skip #noqa
文件“D:\ Program Files(x86)\ Python37-32 \ lib \ site-packages \ pip-19.1.1-py3.7.egg \ pip_internal init .py”,第19行,
来自pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError:没有名为'pip._vendor'的模块。最后删除脚本下的pip的文件,然后python -m ensurepip,再easy_install.exe pip,解决了

我是win10,提示有1.1.1更新,,怎么试都不行,弄了一天,报错:从点子。内部导入主要作为主#isort:skip #noqa
文件“D:\ Program Files(x86)\ Python37-32 \ lib \ site-packages \ pip-19.1.1-py3.7.egg \ pip_internal init .py”,第19行,
来自pip._vendor.urllib3.exceptions import DependencyWarning
ModuleNotFoundError:没有名为'pip._vendor'的模块。最后删除脚Scripts下相关的pip的文件,然后python -m ensurepip,再easy_install.exe pip,解决了

Hi @jibanhenry. If this is still affecting you please let us know and we can dig into it more.

For anyone else experiencing issues, please do not hesitate to create an issue with details.

Was this page helpful?
0 / 5 - 0 ratings