python - Pandas Module: Works in PyCharm but not Terminal -


i've written python script (called python_script.py) in pycharm relies on pandas module. thing is, when run script in pycharm, works perfectly. when call in terminal, following error:

traceback (most recent call last): file "./sub_directory/python_script.py", line 9, in <module> import pandas importerror: no module named pandas 

you install pandas anaconda installation doing conda install pandas @ terminal. that's easiest solution, use other python installation this:

/library/frameworks/python.framework/versions/2.7/resources/python.app/contents‌​/macos/python python_script.py 

you create alias within terminal python point system python installation. can put line

alias python=/library/frameworks/python.framework/versions/2.7/resources/python.app/contents‌​/macos/python 

in ~/.bash_profile

(for reference: http://www.moncefbelyamani.com/create-aliases-in-bash-profile-to-assign-shortcuts-for-common-terminal-commands/)


Comments