import numpy as np
File \"/home/anirrudh/.virtualenvs/ml4t2/local/lib/python2.7/site-packages/numpy/__init__.py\", line 180, in
from . import ad
This happened to me in Windows with Anaconda. I fixed it by removing the python3 path from the environment variable PATH
.
(Answer posted on behalf of the OP).
Update: Resolved.
I had created a python file for one of my projects name random.py and when numpy is imported, it was calling this file instead of it's own library file hence resulting in the error. I had to delete/rename random.py which I created and that fixed the issue.
It happened to me in a specific ipynb, once I crated a copy of the notebook with a different name I was able to import numpy.
Try running it in Python 2 instead of Python 3 - you may have the older version of Spark
Another common problem here (which I had)...check to make sure you dont have a PYTHONPATH env var pointing to a different version of python site-packages (this happened because I updated my python version and didn't change this...it loads from PYTHONPATH first).