Solving Virtualenv Error Unable to locate finder for ‘pip._vendor.distlib’ – when using pip install virtualenv

Virtualenv Error Unable to locate finder for ‘pip._vendor.distlib’ – when using pip install virtualenv is an error which occurs when you try to install virtualenv using pip.

In the blog post I attempt to explain why this error takes place and how you can solve it, I will also add other solutions that could solve the error if possible.

Exploring the Virtualenv Error Unable to locate finder for ‘pip._vendor.distlib’ – when using pip install virtualenv

This is an error which occurs when you try to install virtualenv using pip.

Bellow is the error message, please make sure it is the right one.

                                                                       #
pip._vendor.distlib.DistlibException: Unable to locate finder for 'pip._vendor.distlib'
                                                                       #

Bellow we will describe how the error can be solved. With multiple possible solutions.

Solution 1 : Use easy_install to upgrade pip and/or Download get-pip.py

This is a popular error which takes place when you try using pip in order to install virtualenv.

The first solution offers two options. The first option is to upgrade pip using easy_install. Like in the following command.

                                                                       #
easy_install --upgrade pip
                                                                       #

Try installing the virtualenv again, if that does not work then proceed to the bellow steps.

Next step is to remove pip and Setuptools, using pip uninstall pip setuptools

                                                                       #
python -m pip uninstall pip setuptools
                                                                       #

Then navigate to this link and download get-pip.py then run it

                                                                       #
python get-pip.py
                                                                       #

I hope this method has solved your problem, try the second method if this one does not do the job.

Solution 2 : Use python -m ensurepip before upgrading pip

The second method is a step by step solution.

First, we should uninstall pip using the command bellow

                                                                       #
python -m pip uninstall pip
                                                                       #

Note : if the command above does not work you can try the last command in the bottom of this Method (Method 2).

Then run this command

                                                                       #
python -m ensurepip
                                                                       #

Finally, install pip using the following command

                                                                       #
python -m pip install -U pip
                                                                       #

Note : bellow is the command you can use instead of the first command : python -m pip uninstall pip

                                                                       #
python -m pip uninstall pip setuptools
                                                                       #

I hope the fixes above fixed your problem, good luck with your next python project.

Summing-up : 

You can help me and my blog and content by donating to me on Kofi, I have a big red Kofi Button at the top of this page.

Thank you for reading, keep coding and cheers. If you want to learn more about Python, please check out the Python Documentation : https://docs.python.org/3/