'pkg_resources.DistributionNotFound: The 'pip==19.0.3' distribution was not found and is required by the application

Traceback (most recent call last):
  File "C:\Users\Falcon\Desktop\untitled3\Scripts\pip-script.py", line 6, in <module>
    from pkg_resources import load_entry_point
  File "C:\Users\Falcon\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pkg_resources\__init__.py", line 3088, in <module>
    @_call_aside
  File "C:\Users\Falcon\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pkg_resources\__init__.py", line 3072, in _call_aside
    f(*args, **kwargs)
  File "C:\Users\Falcon\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pkg_resources\__init__.py", line 3101, in _initialize_master_workin
g_set
    working_set = WorkingSet._build_master()
  File "C:\Users\Falcon\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pkg_resources\__init__.py", line 576, in _build_master
    return cls._build_from_requirements(__requires__)
  File "C:\Users\Falcon\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pkg_resources\__init__.py", line 589, in _build_from_requirements
    dists = ws.resolve(reqs, Environment())
  File "C:\Users\Falcon\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pkg_resources\__init__.py", line 778, in resolve
    raise DistributionNotFound(req, requirers)
pkg_resources.DistributionNotFound: The 'pip==19.0.3' distribution was not found and is required by the application

Got this when I was running

pip install distutiles

I need this to run py2exe so any help is appreciated.



Solution 1:[1]

try updating pip with

pip install -U pip

It looks like your problem is that you have an older version of pip

Solution 2:[2]

For me, upgrading pip with

sudo python -m pip install --upgrade pip

did the trick.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 mark pedersen
Solution 2 Felix Kemeth