0
votes

I am using a mac OS Sierra 10.12.3 using Pycharm Community Edition 2016.3.2 in PyCharm i am using Python 2.7.11 and tried to run the following

import pandas as pd it gives me error saying no modules named pandas

so i went to my terminal and typed pip install pandas

here is the response

Brians-MBP:~ brians$ pip install pandas Requirement already satisfied: pandas in ./miniconda3/lib/python3.5/site-packages/pandas-0.19.2-py3.5-macosx-10.6-x86_64.egg Requirement already satisfied: python-dateutil>=2 in ./miniconda3/lib/python3.5/site-packages/python_dateutil-2.6.0-py3.5.egg (from pandas) Requirement already satisfied: pytz>=2011k in ./miniconda3/lib/python3.5/site-packages/pytz-2016.10-py3.5.egg (from pandas) Requirement already satisfied: numpy>=1.7.0 in ./miniconda3/lib/python3.5/site-packages/numpy-1.12.0-py3.5-macosx-10.6-x86_64.egg (from pandas) Requirement already satisfied: six>=1.5 in ./miniconda3/lib/python3.5/site-packages/six-1.10.0-py3.5.egg (from python-dateutil>=2->pandas)

When I go to preferences - project interpreter and select 2.7.11 as my interpreter it does not show pandas.

but when i select 3.5.2 (~/miniconda3/bin/python) it does show pandas.

How do I link pandas to 2.7.11?

2

2 Answers

1
votes

open PyCharm, go o preferences and then go to the Project Interpreter section. From there you can click the + button and then click on pandas and then click install packages

0
votes

Mac OSX computers come with a version of Python 2.x pre-installed. The precise version depends on the recency of the computer, but all now ship with 2.7.11. Try opening a new command line and running which -a python in your command line: you should see something like /System/Library/Frameworks/Python.framework/Versions/2.7.

To install on this Python, you can open a new Terminal and simply run pip install pandas.

Note however that messing with your system Python is not recommended. It's strongly recommended that you use a virtualenv or conda (which you appear to be using) to virtualize the environment instead.

And while there is a way of achieving the same affect within PyCharm itself, this isn't a PyCharm-specific problem.