Search code examples
pythoneasy-install

easy_install--failure to import


I'm trying to learn web.py and I'm running into issues. I'm using Mac OSX Lion and what I'm doing is that I installed Python using Homebrew and then installed easy_install. I then did sudo easy_install web.py and it appeared to build correctly. However, when I run Python, I can't run "import web" because it can't find the module. I checked the web.py page and it says that if modules appear to install correctly but can't be imported then they're not going into /Library/Python/2.x/site-packages, but I definitely see web.py sitting there.

Any help on resolving this issue would be appreciated.

Thanks!


Solution

  • Is your /usr/local/bin/python set to the version in your cellar? If so, then

    python setup.py install 
    

    should do the trick.

    You could try creating a symbolic link in /usr/local/bin that points to the cellar. Example:

    ln -s python  /usr/local/Cellar/python/2.7.2/bin/python
    

    I use homebrew on Mac OS X (10.5.8). And, that worked for me.