Q:

why import is not working here? 

I am building numpy and was wondering why they have used the relative imports inside here .  Why have they used relative imports instead of direct imports like import fft (say).   
I thought direct imports would work so cloned it and changed source line 197 to 
import fft

, but it did not work .It threw error as

ImportError: No module named fft

why is it not able to find fft module even though it is in the same folder as numpy __init__.py  . 
so I simulated a similar environment to see why it did not work .  I created module(mod1) and another (mod2) inside it .  and from mod1 __init__.py I imported mod2 and finally added the folder containing module mod1 to python path . 
and then wrote a python script as sample.py which contained
import mod1 

and everything worked fine without need for relative import. 
But why is it not working here inside numpy ? 
Note : I am having numpy inside virtual-env .  Is that causing trouble ? 
Update on debugging : 
import numpy.fft 

worked .  and I checked "__name__" and it was numpy .  But why "numpy."  is needed as it is already in numpy module ???  And more importantly since __name__ was set to numpy it should have been able to figure out the fft module which is within it. Confused why it is not working... My example that I used to simulate is same scenario where I just used the import mod2 despite mod2 was inside mod1 and I did not have to do import mod1.mod2 

A:

This line is your problem:
from __future__ import absolute_import

You cannot use implicit relative imports when this future statement is active.   You must either use a fully absolute import (import numpy.fft) or an explicit relative import (from .  import fft).   See PEP 328 for further discussion of this.