You can try running the following command in the directory where your script is doing:
on Windows
python path_to_scripts\f2py.py -c -m module_name prog.f90 --fcompiler=gfortran
on Linux
python path_to_scripts/f2py.py -c -m module_name prog.f90 --fcompiler=gfortran
Where path_to_scripts
is the path to the Scripts
directory. For example: C:\Python27\Scripts
. In case of Canopy you have to look where this directory is...