While trying to build my python by adding numpy to it I managed to have created problems somewhere. Now, even though I have numpy and other packages like BeautifulSoup installed, I'm unable to import them from within my mac's default python. Previously I was able to import them.
Where should I be initially looking that the potential problem likely is? My bash profile? .profile? Somewhere in python? Any help would be appreciated. I'm very new to installing packages as well as path variables so any guidance on which direction the error likely is would be helpful.
EDIT
After following John Keyes' advice and printing python's path this was the result:
['', '/Library/Python/2.7/site-packages/pip-1.0.2-py2.7.egg', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages', '/Library/Python/2.7/site-packages/setuptools-0.6c11-py2.7.egg-info']
Should these paths include my installed packages (such as numpy and beautiful soup) listed?
EDIT 2
This is my bash profile. From the comments on my question it seems like these may be th eissue, so I thought I'd include them below. How can I change them so that my python build will go back to installing things in the right place?
export PATH=/usr/local/bin:/usr/local/share/python:/usr/local/sbin:$PATH
# Setting PATH for Python 2.7
# The orginal version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/2.7/bin:${PATH}"
export PATH
python -c "import sys; print sys.path"
which will print each path wherepython
finds it's available packages and modules. – John Keyes Oct 10 '11 at 11:55/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages
and you will see what packages have been installed. – John Keyes Oct 10 '11 at 12:49site-packages
) you should see what additional packages you've added to the python installation. You can do this via the Finder (open a Terminal and typeopen <DIR>
) or directly in the Terminal (cd <DIR>; ls -l
). – John Keyes Oct 12 '11 at 20:06