Q:

NameError: name 'f2py' is not defined

after installing python, numpy and scipy_dist_utils i typed f2py onto the python interpretor
the result is as below
>>> f2py
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    f2py
NameError: name 'f2py' is not defined
>>> import numpy
>>> f2py
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    f2py
NameError: name 'f2py' is not defined

from numpy import f2py solved the problem
 but this does not work now
f2py -c --help-fcompiler
f2py -c --help-fcompiler
Traceback (most recent call last):
  File "", line 1, in 
    f2py -c --help-fcompiler
NameError: name 'c' is not defined

What has gone wrong? could anyone help me with this?

A:

If you are trying to run f2py, you do that from your command shell (bash or whatever on UNIX machines, CMD on Windows), not from the Python interpreter. There isn't a whole lot you can do with 
Also, scipy_distutils is very, very old and not at all used anymore. Whatever instructions that told you to install that are incredibly out of date. For a somewhat more up to date set of instructions:
http://www.scipy.org/F2py

