easily troubleshoot easy_install on mac
A friend was having trouble installing Beautiful Soup (a python library for web crawling) using pip install beautifulsoup4 (mainly because he didn’t have pip installed and could not install pip using easy_install for some reason). In these situations it’s often easier to remove old installs and start fresh. Below I show how to remove old easy_install scripts, reinstall it, and then install pip to ultimately get the Beautiful Soup python package (on a mac).
Here’s the error message he was getting. The solution I’m providing is down below.
pip install beautifulsoup4
-bash: pip: command not found
easy_install beautifulsoup4
Traceback (most recent call last):
File "/usr/local/bin/easy_install", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2793, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 673, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 576, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: distribute==0.6.10
To resolve this, first remove old easy_install scripts from the following directories
sudo rm -f /usr/bin/easy_install*
sudo rm -f /usr/local/bin/easy_install*
Then download and run the distribute_setup.py
curl -O https://svn.apache.org/repos/asf/oodt/tools/oodtsite.publisher/trunk/distribute_setup.py
sudo python distribute_setup.py
sudo rm distribute_setup.py
And finally, install Beautiful Soup
pip install beautifulsoup4