I recently upgraded to OSX Sierra, and now I can't import any packages in Python. When I run a standard import numpy
in the python console (I'm using Pycharm) I get
Traceback (most recent call last):
File "<input>", line 1, in <module>
File "/Applications/PyCharm CE.app/Contents/helpers/pydev/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: No module named numpy
I think the problem's coming from when I reinstalled my ports when I was migrating macports, according to the instructions here. I'm pretty sure everything was working in python after I'd upgraded to Sierra, but broke once I did this.
My first thought was to reinstall numpy, but when I go to the command line and run pip install numpy
, I get
Requirement already satisfied: numpy in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python.
However, running which numpy
turns up nothing, which seems weird, since it just told me that numpy's installed, and I can find it on my computer if I use easyfind. Since it might be relevant, which python
gives me /opt/local/bin/python
.
I've tried a few different fixes, but haven't been able to get anything to work so far. I have a feeling that I'm missing something very basic, but can't figure out what it is. I'm running python 2.7.12 on mac 10.12.1.