whenever I use pip installer I get this error on my Mac terminal [duplicate]

I ran across the same problem after solving the "missing pyparsing module" bug over here. I then started getting this error:

Traceback (most recent call last):
  File "/usr/bin/pip", line 5, in <module>
    from pkg_resources import load_entry_point
  File "/usr/local/lib/python2.7/dist-packages/pkg_resources/__init__.py", line 74, in <module>
    import appdirs
ImportError: No module named appdirs

I then used the manual installation steps there to find the missing package on pypi.python.org and came up with this manual installation sequence:

wget https://pypi.python.org/packages/48/69/d87c60746b393309ca30761f8e2b49473d43450b150cb08f3c6df5c11be5/appdirs-1.4.3.tar.gz
gunzip appdirs-1.4.3.tar.gz
tar -xvf appdirs-1.4.3.tar
cd appdirs-1.4.3
sudo python setup.py install

And that fixed it!


For some reason your pipenv installation is not completely done, maybe if you just uninstall and install all missing packages again, it can works. For example, if you are using a MAC:

sudo pip uninstall <missing packages> and after sudo pip install <missing packages>

In this specific case:

sudo pip uninstall appdirs and sudo pip install appdirs