Python packages not available after install with p

2019-09-04 03:40发布

问题:

I am working on a Macbook with Python 2.7.5 pre-installed. I installed the pandas package via command-line with the following code.

pip install pandas

This completed without errors. However, when I try to run the following code in Netbeans, I get an error.

if __name__ == "__main__":
import pandas as pd  

The error is: ImportError: No module named pandas

When I try to re-install the pandas package in the terminal I get the message: Requirement already satisfied (use --upgrade to upgrade): pandas in /usr/local/lib/python2.7/site-packages

What am I doing wrong here?

Thanks for the help!