I am a bit of a Python newbie, and am struggling with what seems like a simple task.
I have installed Python using Homebrew on my Mac. When I run which python it returns /usr/local/bin/python and when I run ls -al /usr/local/bin/python I can see that python is symlinked as follows /usr/local/bin/python -> ../Cellar/python/2.7.1/bin/python, indicating that Homebrew’s version of Python is installed.
Now when I install the boto module, I did so as follows:
easy_install boto and it showed me that the module is installed into /Library/Python/2.7/site-packages/boto-2.2.2-py2.7.egg
The odd thing is that when I do the following, I am told the boto module does not exist.
$ python
Python 2.7.1 (r271:86832, Aug 31 2011, 23:21:36)
>>> import boto
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named boto
Why is that module not available? It’s almost like Homebrew is installing modules into the standard library folder, but is not linking back to that directory when searching for installed modules.
Can anyone explain what is going on?
Thanks
easy_installis a script which calls a certain version of python. It must be pointing to the wrong python in your case.Notice that in my example,
easy_installis calling/usr/bin/python:Change the first line to point to
/usr/local/bin/python.Alternatively, your installation of
Homebrewmight come with its owneasy_install. In that case, just findHomebrew‘s easy_install and call that one.